# lxc-snapshot

## NAME



           lxc-snapshot - Snapshot an existing container.
    


## SYNOPSIS



           **lxc-snapshot**{-n, --name _name_} [-c, --comment _file_]
           **lxc-snapshot**{-n, --name _name_} {-d, -destroy _snapshot-name_}
           **lxc-snapshot**{-n, --name _name_} {-L, --list } [-C, --showcomments ]
           **lxc-snapshot**{-n, --name _name_} {-r, -restore _snapshot-name_} [-N,
                        --newname _newname_]
    


## DESCRIPTION



           **lxc-snapshot** creates, lists, and restores container snapshots.
    
           Snapshots  are stored as snapshotted containers under the contain‐
           er's configuration path. For instance, if the container's configu‐
           ration path is _/var/lib/lxc_ and the  container  is  _c1_ ,  then  the
           first  snapshot  will  be stored as container _snap0_ under the path
           _/var/lib/lxc/c1/snaps_.  If _/var/lib/lxcsnaps_ , as used by LXC  1.0,
           already exists, then it will continue to be used.
    


## OPTIONS



           **-c,--comment** _comment_file_
                  Associate the comment in _comment_file_ with the newly creat‐
                  ed snapshot.
    
           **-d,--destroy snapshot-name**
                  Destroy the named snapshot. If the named snapshot is ALL,
                  then all snapshots will be destroyed.
    
           **-L,--list**
                  List existing snapshots.
    
           **-C,--showcomments**
                  Show snapshot comments in the snapshots listings.
    
           **-r,--restore snapshot-name**
                  Restore the named snapshot, meaning a full new container is
                  created which is a copy of the snapshot.
    
           **-N, --newname**
                  When restoring a snapshot, the last optional argument if
                  not given explicitly via **--newname** is the name to use for
                  the restored container. If the newname is identical to the
                  original name of the container, then the original container
                  will be destroyed and the restored container will take its
                  place. Note that deleting the original snapshot is not pos‐
                  sible in the case of overlayfs or zfs backed snapshots.
    


## COMMON OPTIONS



           These options are common to most of lxc commands.
    
           **-?, -h, --help**
                  Print a longer usage message than normal.
    
           **--usage**
                  Give the usage message
    
           **-q, --quiet**
                  mute on
    
           **-P, --lxcpath=**_PATH_
                  Use an alternate container path. The default is
                  /var/lib/lxc.
    
           **-o, --logfile=**_FILE_
                  Output to an alternate log _FILE_. The default is no log.
    
           **-l, --logpriority=**_LEVEL_
                  Set log priority to _LEVEL_. The default log priority is ER‐
                  ROR. Possible values are : FATAL, ALERT, CRIT, WARN, ERROR,
                  NOTICE, INFO, DEBUG, TRACE.
    
                  Note that this option is setting the priority of the events
                  log in the alternate log file. It do not have effect on the
                  ERROR events log on stderr.
    
           **-n, --name=**_NAME_
                  Use container identifier _NAME_.  The container identifier
                  format is an alphanumeric string.
    
           **--rcfile=**_FILE_
                  Specify the configuration file to configure the virtualiza‐
                  tion and isolation functionalities for the container.
    
                  This configuration file if present will be used even if
                  there is already a configuration file present in the previ‐
                  ously created container (via lxc-create).
    
           **--version**
                  Show the version number.
    


* * *