Blob Blame History Raw
'\" t
.\"     Title: criu
.\"    Author: [see the "AUTHOR" section]
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
.\"      Date: 06/14/2016
.\"    Manual: CRIU Manual
.\"    Source: criu 2.3
.\"  Language: English
.\"
.TH "CRIU" "8" "06/14/2016" "criu 2\&.3" "CRIU Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
criu \- checkpoint/restore in userspace
.SH "SYNOPSIS"
.sp
\fBcriu\fR \fI<command>\fR [\fIoptions\fR]
.SH "DESCRIPTION"
.sp
\fBcriu\fR is a tool for checkpointing and restoring running applications\&. It does this by saving their state as a collection of files (see the \fIdump\fR command) and creating equivalent processes from those files (see the \fIrestore\fR command)\&. The restore operation can be performed at a later time, on a different system, or both\&.
.SH "OPTIONS"
.sp
The options are depending on the \fI<command>\fR \fBcriu\fR run with\&.
.SS "Common options"
.sp
Common options are applied to any \fI<command>\fR\&.
.PP
\fB\-v\fR[\fI<num>\fR|\fBv\fR\&...]
.RS 4
Set logging level to
\fI<num>\fR\&. The higer the level, the more output is produced\&. Either numeric values or multiple
\fBv\fR
can be used\&.

The following levels are available:
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fB\-v1\fR,
\fB\-v\fR
only messages and errors;
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fB\-v2\fR,
\fB\-vv\fR
also warnings (default level);
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fB\-v3\fR,
\fB\-vvv\fR
also information messages and timestamps;
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fB\-v4\fR,
\fB\-vvvv\fR
lots of debug\&.
.RE
.RE
.PP
\fB\-\-pidfile\fR \fI<file>\fR
.RS 4
Write root task, service or page\-server pid into a
\fI<file>\fR\&.
.RE
.PP
\fB\-o\fR, \fB\-\-log\-file\fR \fI<file>\fR
.RS 4
Write logging messages to
\fI<file>\fR\&.
.RE
.PP
\fB\-\-log\-pid\fR
.RS 4
Write separate logging files per each pid\&.
.RE
.PP
\fB\-D\fR, \fB\-\-images\-dir\fR \fI<path>\fR
.RS 4
Use path
\fI<path>\fR
as a base directory where to look for dump files set\&.
.RE
.PP
\fB\-\-prev\-images\-dir\fR \fI<path>\fR
.RS 4
Use path
\fI<path>\fR
as a parent directory where to look for dump files set\&. This make sence in case of increment dumps\&.
.RE
.PP
\fB\-W\fR, \fB\-\-work\-dir\fR \fI<dir>\fR
.RS 4
Use directory
\fI<dir>\fR
for putting logs, pidfiles and statistics\&. If not specified,
\fI<path>\fR
from
\fB\-D\fR
option is taken\&.
.RE
.PP
\fB\-\-close\fR \fI<fd>\fR
.RS 4
Close file with descriptor
\fI<fd>\fR
before any actions\&.
.RE
.PP
\fB\-L\fR, \fB\-\-libdir\fR \fI<path>\fR
.RS 4
Path to a plugins directory\&.
.RE
.PP
\fB\-\-action\-script\fR \fI<SCRIPT>\fR
.RS 4
Add an external action script\&. The environment variable
\fBCRTOOLS_SCRIPT_ACTION\fR
contains one of the actions:
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBpre\-dump\fR
run an action prior to beginning a
\fBdump\fR
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBpost\-dump\fR
run an action upon
\fBdump\fR
completion;
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBpre\-restore\fR
run an action prior to beginning a
\fBrestore\fR
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBpost\-restore\fR
run an action upon
\fBrestore\fR
completion;
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBnetwork\-lock\fR
lock network in a target network namespace;
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBnetwork\-unlock\fR
unlock network in a target network namespace;
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBsetup\-namespaces\fR
run an action once root task just been created with required namespaces, note it is early stage on restore nothing were restored yet except namespaces themselves\&.
.RE
.RE
.PP
\fB\-V\fR, \fB\-\-version\fR
.RS 4
Print program version and exit\&.
.RE
.PP
\fB\-h\fR, \fB\-\-help\fR
.RS 4
Print a commands list and exit\&. The commands list is very short one just for overview and does not match this manual\&.
.RE
.SS "pre\-dump"
.sp
Launches that named pre\-dump procedure, where \fBcriu\fR does snapshot of memory changes since previous pre\-dump\&. Also \fBcriu\fR forms fsnotify cache which speedup \fBrestore\fR procedure\&. \fBpre\-dump\fR requires at least \fB\-t\fR option (see \fBdump\fR below)\&. Optionally \fBpage\-server\fR options may be specified\&.
.PP
\fB\-\-track\-mem\fR
.RS 4
Turn on memory changes tracker in the kernel\&. If the option is not passed the memory tracker get turned on implicitly\&.
.RE
.SS "dump"
.sp
Starts a checkpoint procedure\&.
.PP
\fB\-t\fR, \fB\-\-tree\fR \fI<pid>\fR
.RS 4
Checkpoint the whole process tree starting from
\fI<pid>\fR\&.
.RE
.PP
\fB\-R\fR, \fB\-\-leave\-running\fR
.RS 4
Leave tasks in running state after checkpoint instead of killing them\&. This option is pretty dangerous and should be used if and only if you understand what you are doing\&.
.sp
If task is about to run after been checkpointed it can modify TCP connections, delete files and do other dangerous actions\&. So that
\fBcriu\fR
itself can not guarantee that the next
\fBrestore\fR
action will not fail\&. Most likely if a user starts
\fBcriu\fR
with this option passed at least the file system snapshot must be done with help of
\fIpost\-dump\fR
script\&.
.sp
In other words, do not use it until really needed\&.
.RE
.PP
\fB\-s\fR, \fB\-\-leave\-stopped\fR
.RS 4
Leave tasks in stopped state after checkpoint instead of killing them\&.
.RE
.PP
\fB\-x\fR, \fB\-\-ext\-unix\-sk\fR [\fI<inode>\fR,<inode>\*(Aq]
.RS 4
Dump external unix sockets\&. Optionally passing
\fI<inode>\fR
(or comma separated series) it assigns inodes which allowed for one sided dump\&.
.RE
.PP
\fB\-\-freeze\-cgroup\fR
.RS 4
Use cgroup freezer to collect processes\&.
.RE
.PP
\fB\-\-manage\-cgroups\fR
.RS 4
Collect cgroups into the image thus they gonna be restored then\&. Without this argument
\fBcriu\fR
will not save cgroups configuration associated with a task\&.
.RE
.PP
\fB\-\-tcp\-established\fR
.RS 4
Checkpoint established TCP connections\&.
.RE
.PP
\fB\-\-veth\-pair\fR \fI<IN>\fR\fB=\fR\fI<OUT>\fR
.RS 4
Correspondence between outside and inside names of veth devices\&.
.RE
.PP
\fB\-\-evasive\-devices\fR
.RS 4
Use any path to a device file if the original one is inaccessible\&.
.RE
.PP
\fB\-\-page\-server\fR
.RS 4
Send pages to a page server (see
\fBpage\-server\fR
command)\&.
.RE
.PP
\fB\-\-force\-irmap\fR
.RS 4
Force resolving names for inotify and fsnotify watches\&.
.RE
.PP
\fB\-\-auto\-dedup\fR
.RS 4
Deduplicate "old" data in pages images of previous
\fBdump\fR\&. Which implies incremental
\fBdump\fR
mode (see
\fBpre\-dump\fR
command)\&.
.RE
.PP
\fB\-l\fR, \fB\-\-file\-locks\fR
.RS 4
Dump file locks\&. It is necessary to make sure that all file lock users are taken into dump, so it is only safe to use this for enclojured containers where locks are not holed by someone outside of it\&.
.RE
.PP
\fB\-M\fR, \fB\-\-ext\-mount\-map\fR \fI<KEY>\fR\fB:\fR\fI<VAL>\fR
.RS 4
Setup mapping for external mounts\&.
\fI<KEY>\fR
is a mountpoint inside container and corresponding
\fI<VAL>\fR
is a string that will be written into the image as mountpoint\*(Aqs root value\&.
.RE
.PP
\fB\-\-link\-remap\fR
.RS 4
Allow one to link unlinked files back when possible (modifies FS till
\fBrestore\fR)\&.
.RE
.PP
\fB\-\-ghost\-limit\fR \fIsize\fR
.RS 4
Allow one to specify maximum allowed size of deleted file to be carried inside image files\&. By default up to 1M file is allowed\&. It is done in a sake to not carry big files inside images\&.
\fIsize\fR
may be postfixed with
\fIK\fR,
\fIM\fR
or
\fIG\fR
(which stands for kilo, mega and gigabytes accordingly)\&.
.RE
.PP
\fB\-j\fR, \fB\-\-shell\-job\fR
.RS 4
Allow one to dump shell jobs\&. This implies the restored task will inherit session and process group ID from the criu itself\&. Also this option allows one to migrate a single external tty connection, in other words this option allows one to migrate such application as "top" and friends\&. If passed on
\fBdump\fR
it must be specified on
\fBrestore\fR
as well\&.
.RE
.PP
\fB\-\-cpu\-cap\fR [,\fI<cap>\fR]
.RS 4
Specify
\fIcap\fR
CPU capability to be written into an image file\&. Basically if
\fI<cap>\fR
is one of
\fBall\fR,
\fBcpu\fR
or
\fBins\fR, then
\fBcriu\fR
writes CPU related information into image file\&. If the option is omitted or set to
\fBnone\fR
then image will not be written\&. By default
\fBcriu\fR
do not write this image\&.
.RE
.SS "restore"
.sp
Restores previously checkpointed processes\&.
.PP
\fB\-\-inherit\-fd\fR \fIfd[<num>]:<existing>\fR
.RS 4
Inherit file descriptors\&. This allows one to treat file descriptor
\fI<num>\fR
as being already opened via
\fI<existing>\fR
one and instead of trying to open we inherit it\&.
.RE
.PP
\fB\-d\fR, \fB\-\-restore\-detached\fR
.RS 4
Detach
\fBcriu\fR
itself once restore is complete\&.
.RE
.PP
\fB\-S\fR, \fB\-\-restore\-sibling\fR
.RS 4
Restore root task as a sibling (make sense with
\fB\-\-restore\-detached\fR) only\&.
.RE
.PP
\fB\-r\fR, \fB\-\-root\fR \fI<path>\fR
.RS 4
Change the root filesystem to <path> (when run in mount namespace)\&.
.RE
.PP
\fB\-\-manage\-cgroups\fR [<mode>]
.RS 4
Restore cgroups configuration associated with a task from the image\&. Controllers are always restored in optimistic way \(em if already present in system
\fBcriu\fR
reuses it, otherwise it will be created\&.
.sp
The
\fI<mode>\fR
may be one of below\&.
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBnone\fR\&. Do not restore cgroup properties but require cgroup to pre\-exist at the moment of
\fBrestore\fR
procedure\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBprops\fR\&. Restore cgroup properties and require cgroup to pre\-exist\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBsoft\fR\&. Restore cgroup properties if only cgroup has been created by
\fBcriu\fR, otherwise do not restore properies\&. This is the default if mode is unspecified\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBfull\fR\&. Always restore all cgroups and their properties\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBstrict\fR\&. Restore all cgroups and their properties from the scratch, requiring them to not present in the system\&.
.RE
.RE
.PP
\fB\-\-cgroup\-root\fR \fI[<controller>:]/<newroot>\fR
.RS 4
Change the root cgroup the controller will be installed into\&. No controller means that root is the default for all controllers not specified\&.
.RE
.PP
\fB\-\-tcp\-established\fR
.RS 4
Restore previously dumped established TCP connections\&. This implies that the network has been locked between
\fBdump\fR
and
\fBrestore\fR
phases so other side of a connection simply notice a kind of lag\&.
.RE
.PP
\fB\-\-veth\-pair\fR \fI<IN>\fR\fB=\fR\fI<OUT>\fR
.RS 4
Correspondence between outside and inside names of veth devices\&.
.RE
.PP
\fB\-l\fR, \fB\-\-file\-locks\fR
.RS 4
Restore file locks from the image\&.
.RE
.PP
\fB\-M\fR, \fB\-\-ext\-mount\-map\fR \fI<KEY>\fR\fB:\fR\fI<VAL>\fR
.RS 4
Setup mapping for external mounts\&.
\fI<KEY>\fR
is the value from the image (\fI<VAL>\fR
from dump) and the
\fI<VAL>\fR
is the path on host that will be bind\-mounted into container (to the mountpoint path from image)\&.
.RE
.PP
\fB\-\-ext\-mount\-map\fR \fBauto\fR
.RS 4
This is a special case\&. If this flag is passed, when an external mount is missing from the command line
\fI\fB\-\-ext\-mount\-map\fR\fR\fI <KEY>:<VAL>\fR
syntax, criu attempts to automatically resolve this mount from its namespace\&.
.RE
.PP
\fB\-\-enable\-external\-sharing\fR, \fB\-\-enable\-external\-masters\fR
.RS 4
These flags enable external shared or slave mounts to be resolved automatically when
\fI\fB\-\-ext\-mount\-map auto\fR\fR
is passed\&.
.RE
.PP
\fB\-\-auto\-dedup\fR
.RS 4
As soon as a page is restored it get punched out from image\&.
.RE
.PP
\fB\-j\fR, \fB\-\-shell\-job\fR
.RS 4
Restore shell jobs, in other words inherit session and process group ID from the criu itself\&.
.RE
.PP
\fB\-\-cpu\-cap\fR [\fI<cap>\fR,\fI<cap>\fR]
.RS 4
Specify
\fI<cap>\fR
CPU capability to be present on the CPU the process is restoring\&. To inverse capability prefix it with
\fB^\fR\&. This option implies that
\fB\-\-cpu\-cap\fR
has been passed on
\fBdump\fR
as well, except
\fBfpu\fR
option case\&.
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBall\fR\&. Require all capabilities\&. This is
\fBdefault\fR
mode if
\fB\-\-cpu\-cap\fR
is passed without arguments\&. Most safe mode\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBcpu\fR\&. Require the CPU to have all capabilities in image to match runtime CPU\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBfpu\fR\&. Requre the CPU to have comaptible FPU\&. For example the process might be dumped with xsave capability but attempted to restore without it present on target CPU\&. In such case we refuse to procceed\&. This is
\fBdefault\fR
mode if
\fB\-\-cpu\-cap\fR
is not present in command line\&. Note this argument might be passed even if on the
\fBdump\fR
no
\fB\-\-cpu\-cap\fR
have been specified becase FPU frames are always encoded into images\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBins\fR\&. Require CPU compatibility on instructions level\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBnone\fR\&. Ignore capabilities\&. Most dangerous mode\&. The behaviour is implementation dependent\&. Try to not use it until really required\&.
.sp
One possible need of using this option is when
\fB\-\-cpu\-cap\fR=\fBcpu\fR
has been passed on
\fBdump\fR
then images are migrated to a less capable processor and one need to
\fBrestore\fR
this application, by default
\fBcriu\fR
will refuse to proceed without relaxing capability with
\fB\-\-cpu\-cap\fR=\fBnone\fR
parameter\&.
.RE
.RE
.SS "check"
.sp
Checks whether the kernel supports the features that \fBcriu\fR needs to successfully dump and restore a process tree\&.
.sp
There are three categories of kernel support as described below\&. \fBcriu check\fR always checks Category 1 features unless \fB\-\-feature\fR is specified which only checks the specified feature\&.
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBCategory 1\fR\&. Absolutely required\&. These are features like
\fI/proc/<pid>/map_files\fR,
\fINETLINK_SOCK_DIAG\fR
socket monitoring,
\fI/proc/sys/kernel/ns_last_pid\fR, etc\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBCategory 2\fR\&. Required only for specific cases\&. These are features like aio remap,
\fI/dev/net/tun\fR, etc\&. that are required if the process being dumped or restored is using them\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBCategory 3\fR\&. Experimental\&. These are features like task\-diag that are used for experimental purposes (mostly during development)\&.
.RE
.sp
If there are no errors or warnings, \fBcriu\fR prints "Looks good\&." and its exit code will be 0\&.
.sp
A missing Category 1 feature causes \fBcriu\fR to print "Does not look good\&." and its exit code will be non\-zero\&.
.sp
Missing Category 2 and 3 features cause \fBcriu\fR to print "Looks good but some kernel features are missing which, depending on your process tree, may cause dump or restore failure\&." and its exit code will be non\-zero\&.
.sp
Without an argument, \fBcriu check\fR checks Category 1 features\&. This behavior can change with the following options:
.PP
\fB\-\-extra\fR
.RS 4
Check kernel support for Category 2 features\&.
.RE
.PP
\fB\-\-experimental\fR
.RS 4
Check kernel support for Category 3 features\&.
.RE
.PP
\fB\-\-all\fR
.RS 4
Check kernel support for Category 1, 2, and 3 features\&.
.RE
.PP
\fB\-\-feature\fR \fI<name>\fR
.RS 4
Check a specific feature\&. If
\fI<name>\fR
is
\fIlist\fR, a list of valid kernel feature names that can be checked will be printed\&.
.RE
.SS "page\-server"
.sp
Launches \fBcriu\fR in page server mode\&.
.PP
\fB\-\-daemon\fR
.RS 4
Runs page server as a daemon (background process)\&.
.RE
.PP
\fB\-\-address\fR \fI<address>\fR
.RS 4
Page server IP address\&.
.RE
.PP
\fB\-\-port\fR \fI<number>\fR
.RS 4
Page server port number\&.
.RE
.SS "exec"
.sp
Executes a system call inside a destination task\*(Aqs context\&.
.SS "service"
.sp
Launches \fBcriu\fR in RPC daemon mode where \fBcriu\fR is listeninп for RPC commands over socket to perform\&. This is convenient for the case where daemon itself is running in a privilege (superuser) mode but clients are not\&.
.SS "dedup"
.sp
Starts pagemap data deduplication procedure, where \fBcriu\fR scans over all pagemap files and tries to minimalize the number of pagemap entries by obtaining the references from a parent pagemap image\&.
.SS "cpuinfo dump"
.sp
Fetches current CPU features and write them into an image file\&.
.SS "cpuinfo check"
.sp
Fetches current CPU features (ie CPU the \fBcriu\fR is running on) and test if they are compatible with ones present in image file\&.
.SH "SYSCALLS EXECUTION"
.sp
To run a system call in another task\*(Aqs context use
.sp
.if n \{\
.RS 4
.\}
.nf
    criu exec \-t pid syscall\-string
.fi
.if n \{\
.RE
.\}
.sp
command\&. The \fIsyscall\-string\fR should look like
.sp
.if n \{\
.RS 4
.\}
.nf
    syscall\-name syscall\-arguments \&.\&.\&.
.fi
.if n \{\
.RE
.\}
.sp
Each command line argument is transformed into the system call argument by the following rules:
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
If one starts with
\fB&\fR, the rest of it gets copied to the target task\*(Aqs address space and the respective syscall argument is the pointer to this string;
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Otherwise it is treated as a number (converted with strtol) and is directly passed into the system call\&.
.RE
.SH "EXAMPLES"
.sp
To checkpoint a program with pid of \fB1234\fR and write all image files into directory \fBcheckpoint\fR:
.sp
.if n \{\
.RS 4
.\}
.nf
    criu dump \-D checkpoint \-t 1234
.fi
.if n \{\
.RE
.\}
.sp
To restore this program detaching criu itself:
.sp
.if n \{\
.RS 4
.\}
.nf
    criu restore \-d \-D checkpoint
.fi
.if n \{\
.RE
.\}
.sp
To close a file descriptor number \fB1\fR in task with pid \fB1234\fR:
.sp
.if n \{\
.RS 4
.\}
.nf
    criu exec \-t 1234 close 1
.fi
.if n \{\
.RE
.\}
.sp
To open a file named \fB/foo/bar\fR for read\-write in the task with pid \fB1234\fR:
.sp
.if n \{\
.RS 4
.\}
.nf
    criu exec \-t 1234 open \*(Aq&/foo/bar\*(Aq 2
.fi
.if n \{\
.RE
.\}
.SH "AUTHOR"
.sp
OpenVZ team\&.
.SH "COPYRIGHT"
.sp
Copyright (C) 2011\-2015, Parallels Inc\&.