I developed an algorithm for a fairly hard problem in mathematics which is likely to need several months to finish. As I have limited resources only, I started this on my Ubuntu 12.04 (x86) laptop. Now I want to install some updates and actually restart the laptop (the please reboot message is just annoying).Is there a way to save an entire process including its allocated memory for continuation beyond a reboot?Here is some information about the process you might need. Please feel free to ask for further information if needed.I called the process in a terminal with the command ./binary > ./somefile & or time ./binary > ./somefile &, I cannot really remember.It's printing some debug information to std::cerr (not very often).It's currently using roughly 600.0 kiB and even though this will increase, it's unlikely to increase rapidly.the process runs with normal prioritythe kernel is 3.2.0-26-generic-pae, the cpu is an AMD, the operating system is Ubuntu 12.04 x86.it runs since 9 days and 14 hours (so too long to cancel it ;-) )
Save entire process for continuation after reboot
process;reboot
The best/simplest solution is to change your program to save the state to a file an reuse that file to restore the process.Based upon the wikipedia page about application snapshots there are multiple alternatives:There is also cryopid but it seems to be unmaintained. Linux checkpoint/restart seems to be a good choice but your kernel needs to have CONFIG_CHECKPOINT_RESTORE enabled.criu is probably the most up to-date project and probably your best shot but depends also on some specific Kernel options which your distribution probably hasn't set.This is already too late but another more hands-on approach is to start your process in a dedicated VM and just suspend and restore the whole Virtual machine. Depending on your hypervisor you can also move the machine between different hosts.For the future think about where you run your long-running processes, how to parallize them and how to handle problems, e.g. full disks, process gets killed etc.