Changes

1,431 bytes added ,  18:46, 14 May 2013
Created page with "If you're doing several dumps in a row, one in some time after another, the 2nd and subsequent dumps can be speed-ed up and that's how == Create the first dump == # mkdir <..."
If you're doing several dumps in a row, one in some time after another, the 2nd and subsequent dumps can be speed-ed up and that's how

== Create the first dump ==

# mkdir <path-to-images>/1/
# criu dump --tree <pid> --images-dir <path-to-images>/1/ --leave-running --track-mem

* Images are put into the <code>1/</code> sub-directory, since we're about to create the 2nd (and more) incremental dumps and it's handy to store them in this way;
* The <code>--leave-running</code> option is used to make criu not kill the tasks after dump, but let them run further;
* The <code>--track-mem</code> option makes criu ask kernel to monitor memory changes to optimize the subsequent dump.

== Create the second dump ==

# mkdir <path-to-images>/2/
# criu dump --tree <pid> --images-dir <path-to-images>/2/ --leave-running --track-mem --prev-images-dir ../1/

* Note, that the <code>--prev-images-dir</code> path is relative to the <code>--images-dir</code> one;
* Similarly the 3rd and all the other dumps can be created.

== Create the last dump ==

# mkdir <path-to-images>/N/
# criu dump --tree <pid> --images-dir <path-to-images>/N/ --prev-images-dir ../N-1/

* No <code>--leave-running</code> option will make tasks be killed after dump;
* No need in memory tracking option.

== Restore ==

Now you can restore the processes from whatever images you want

# criu restore --images-dir <path-to-images>/ANY/

[[Category:HOWTO]]