SNAPPER(8) Filesystem Snapshot Management SNAPPER(8)
NAME
snapper - Command-line program for filesystem snapshot management
SYNOPSIS
snapper [--global-opts] command [--command-opts] [command-arguments]
snapper {--help}
DESCRIPTION
Snapper is a command-line program for filesystem snapshot management. It can create, delete and compare snapshots and undo changes done
between snapshots.
Snapper never modifies the content of snapshots. Thus snapper creates read-only snapshots if supported by the kernel. Supported filesystems
are btrfs as well as snapshots of LVM logical volumes with thin-provisioning.
CONCEPTS
Configurations
For each filesystem or subvolume that should be snapshotted by snapper, a configuration file is required, see snapper-configs(5). The setup
can be done with the create-config command.
Snapshots
Snapper distinguishes three types of snapshots.
pre
Pre snapshots should always have a corresponding post snapshot. The intention of pre/post snapshot pairs is to snapshot the filesystem
before and after a modification.
post
See pre type.
single
These snapshots have no special relationship to other snapshots.
Note that filesystem-wise all three types are the same.
Snapshot Description and Userdata
With each snapshot a description and some userdata can be associated. The description is a string. The userdata is a list of key-value
pairs where the keys and values are strings.
Automatic Snapshot Creation
Next to manual snapshot creation, snapshots are also created automatically.
o A cron-job creates hourly snapshots.
Cleanup Algorithms
Snapper provides several algorithms to clean up old snapshots. The algorithms are executed in a daily cron-job. This can be configured in
the corresponding configurations files along with parameters for every algorithm.
number
Deletes old snapshots when a certain number of snapshots is reached.
timeline
Deletes old snapshots but keeps a number of hourly, daily, monthly and yearly snapshots.
empty-pre-post
Deletes pre/post snapshot pairs with empty diffs.
Filters
Some files keep state information of the system, e.g. /etc/mtab. Such files should never be reverted. To help users, snapper allows to
ignore these files.
Each line in all files /etc/snapper/filters/*.txt specifies a pattern. When snapper computes the difference between two snapshots it
ignores all files and directories matching any of those patterns by using fnmatch(3) with the flag FNM_LEADING_DIR.
Note that filters do not exclude files or directories from being snapshotted. For that, use subvolumes or mount points.
GLOBAL OPTIONS
-q, --quiet
Suppress normal output. Error messages will still be printed, though.
-v, --verbose
Increase verbosity.
-t, --table-style
Specifies table style. Table style is identified by an integer number.
-c, --config name
Use specified configuration instead of the default configuration. The default configuration is named "root".
--no-dbus
Operate without a DBus connection. Only works for some commands.
Use with caution since a running snapperd will not know about modifications made to the system.
--version
Print version and exit.
COMMANDS
Snapper provides a number of commands. Each command accepts the options listed in the GLOBAL OPTIONS section. These options must be
specified before the command name. In addition, many commands have specific options, which are listed in this section. These
command-specific options must be specified after the name of the command and before any of the command arguments.
help
Show short help text.
list-configs
List available configurations.
create-config [options] subvolume
Create a new configuration for a filesystem or subvolume. For this command you will likely need the global option --config, see GLOBAL
OPTIONS and CONCEPTS.
-f, --fstype fstype
Manually set filesystem type. Supported values are btrfs and lvm. For lvm, snapper uses LVM thin-provisioned snapshots. The
filesystem type on top of LVM must be provided in parentheses, e.g. lvm(xfs).
Without this option snapper tries to detect the filesystem.
-t, --template name
Name of template for the new configuration file.
delete-config
Delete a configuration for a filesystem or subvolume. For this command you will likely need to global option --config, see GLOBAL
OPTIONS and CONCEPTS.
get-config
Displays the settings of the configuration.
set-config configdata
Changes the settings of the configuration. The settings configdata are a list of key-value-pairs separated by spaces and the key and
value must be separated by an equal sign, e.g. "NUMBER_CLEANUP=yes NUMBER_LIMIT=10". The value of SUBVOLUME and FSTYPE cannot be
changed.
list [options]
List snapshots.
-t, --type type
Selects type of snapshots to list. Possible values are all, single and pre-post.
create [options]
Create a new snapshot.
-t, --type type
Specifies the type of the new snapshot. Possible values are single, pre and post.
--pre-number number
For post snapshots the number of the pre snapshot must be provided.
-p, --print-number
Print number of the created snapshot.
-d, --description description
Description for the snapshot.
-c, --cleanup-algorithm cleanup-algorithm
Set the cleanup algorithm for the snapshot.
-u, --userdata userdata
Set userdata for the snapshot. The key-value pairs must be separated by comma and the key and value must be separated by an equal
sign, e.g. requestid=42,user=arthur.
--command command
Create a pre and post snapshot and run command in between.
modify [options] number
Modify a snapshot.
-d, --description description
New description for snapshot.
-c, --cleanup-algorithm cleanup-algorithm
Set the cleanup algorithm for the snapshot.
-u, --userdata userdata
Set userdata for the snapshot. The key-value pairs must be separated by comma and the key and value must be separated by an equal
sign, e.g. requestid=42,user=arthur.
delete number | number1-number2
Delete a snapshot or a range of snapshots.
mount number
Mount a snapshot. Not required for all filesystem types.
umount number
Unmount a snapshot. Not required for all filesystem types.
status [options] number1..number2
Compare the snapshots number1 and number2. This will show a list of files and directories that have been created, modified or deleted
in the time between the two snapshots have been made.
-o, --output file
Write output to file file.
diff [options] number1..number2 [files]
Compare the snapshots number1 and number2. This will show a diff of the content of files and directories that have been created,
modified or deleted in the time between the two snapshots have been made.
undochange [options] number1..number2 [files]
Undo changes done between snapshot number1 and number2.
-i, --input file
Read files for which to undo changes from file file.
cleanup cleanup-algorithm
Run the cleanup algorithm cleanup-algorithm. Currently implemented cleanup algorithms are number, timeline and empty-pre-post.
xadiff number1..number2 [files]
Compare the extended attributes between snapshot number1 and number2. See examples below:
o +:user.foo for created attributes
o -:user.bar for removed attributes
o -+:security.selinux for modified attributes
PERMISSIONS
Non-root users can be allowed to use a configuration by setting ALLOW_USERS or ALLOW_GROUPS in the config file. For all operations to work,
the user must also be able to read and access the .snapshots directory inside the subvolume. The .snapshots directory must be owned by root
and must not be writable by anybody else.
FILES
/etc/sysconfig/snapper
Global configuration file.
/etc/snapper/configs
Directory containing configuration files.
/etc/snapper/config-templates
Directory containing configuration templates.
/etc/snapper/filters/*.txt
Filter files.
/var/log/snapper.log
Logfile. Please include this file in bug reports.
NOTES
There is no mechanism to ensure consistency of the files while a snapshot it made. E.g. the files of a database can be inconsistent while
the database is running.
Consistency after undochange is not guaranteed. E.g. when the creation of a user is undone, there might still exist files from that user.
Support for extended attributes is a compile-time option.
HOMEPAGE
http://snapper.io/
AUTHORS
Arvin Schnell <aschnell@suse.de>
SEE ALSO
snapper-configs(5), btrfs(8), lvm(8), attr(5)
0.1.7 2013-04-26 SNAPPER(8)