i have mysql database in which millions of insertions go on. Now there is a possibilty that the power present on laptop is going down and hence i would like to pause the application and resume it afterwards in same machine or in a different machine. All this has to be done programatically. Basically i would read the battery level of the syatem and then save the state. I am using ubuntu linux. I googled for saving application state but could find cryopid that doesn't seem the right candidate for this job. Any ideas on how to accomplish this.