table of contents
- Tumbleweed 0.13.0-5.1
- Leap-16.0
| SNBK(8) | Filesystem Snapshot Management | SNBK(8) |
NAME¶
snbk - Command-line program to backup snapshots of snapper
SYNOPSIS¶
snbk [--global-opts] command [command-arguments]
snbk {--help}
DESCRIPTION¶
Snbk is a command-line program to backup snapshot of snapper. It can transfer and delete backup snapshots on local and remote btrfs filesystems.
CONCEPTS¶
Backup Configurations¶
For each snapper config there can be several backup configs. Each backup config defines backups of the snapper snapshots at one location, either local or remote, see snapper-backup-configs(5) for possible settings.
Snapshot Statuses¶
Each snapshot has a status on the source and on the target. Possible values for the source are:
(empty)
read-only
read-write
Possible values for the target are:
(empty)
valid
invalid
legacy
Visualization¶
Snbk provides a visualize command for producing graphs in Graphviz DOT format for visualization purposes. Currently, producing tree diagrams for snapshots on both the source and the target is supported. The command output can be piped to the Graphviz tools to generate an image.
Here is an example of producing a tree diagram for snapshots on the source side with the 'root' backup config:
# snbk -b root visualize source-tree | dot -T png -o root-source-tree.png
In the tree diagram for snapshots, a node has the properties virtual and valid. A virtual node means the corresponding Btrfs subvolume is not managed by a Snapper snapshot. A valid node means the node exists on both the source and target sides, and can be used as a valid Btrfs send parent to reduce disk usage during snapshot transfer or restoration. The root node of the diagram is a specialized virtual node, which is not a Btrfs subvolume, representing the Btrfs filesystem on the source or target.
GLOBAL OPTIONS¶
-q, --quiet
-v, --verbose
--debug
--utc
--iso
-t, --table-style style
--machine-readable format
--csvout
--jsonout
--separator character
--no-headers
-b, --backup-config name
--no-dbus
Use with caution.
--target-mode name
--automatic
--version
COMMANDS¶
Snbk 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 arguments, which are listed in this section. These command-specific arguments must be specified after the name of the command.
help
list-configs
list (ls)
transfer [number]
restore [number]
delete (remove|rm) [number]
transfer-and-delete
visualize [options] mode
-r, --rankdir rankdir
source-tree
target-tree
RESTORE¶
Snapshots can be restored using the restore command. There are more methods to do a restore, e.g. the backup can be mounted and then copied or rsync can be used.
Here we provide an example on how to manually use btrfs send and receive to restore a snapshot on the source system. In general using btrfs send and receive is a bit tricky.
When using target-mode local:
# mkdir /.snapshots/42 # cp /backups/root/42/info.xml /.snapshots/42/ # btrfs send /backups/root/42/snapshot | btrfs receive /.snapshots/42
When using target-mode ssh-push:
# mkdir /.snapshots/42 # scp backups.example.com:/backups/eberich/root/42/info.xml /.snapshots/42 # ssh backups.example.com btrfs send /backups/eberich/root/42/snapshot | btrfs receive /.snapshots/42
If the system was reinstalled it is unfortunately in general not possibly to simply use the restored snapshot as the new default snapshot since some files, e.g. /etc/fstab, likely need modifications. Also unfortunately for other subvolumes than root a rollback is not supported.
If there are snapshots on the source to speed up the operation you can also use the -p option for btrfs send.
NOTES¶
The content of snapshots transferred must not be changed on the source system. Normally this is ensured since the snapshots are read-only. But it is possible to change snapshots to read-write. This can cause error during transfers in the future.
PERMISSIONS¶
Since the target-mode ssh-push needs root permissions on the target it is recommended to use a dedicated machine or container as a target.
FILES¶
/etc/snapper/backup-configs
EXIT STATUS¶
Normally the exit status is 0. If an error occurred the exit status is 1.
HOMEPAGE¶
AUTHORS¶
Arvin Schnell <aschnell@suse.com>
SEE ALSO¶
snapper-backup-configs(5), snapper(8), btrfs-send(8), btrfs-receive(8) rsync(1), sshfs(1)
NOTES¶
- 1.
- RFC 4180
| 2026-01-16 | 0.13.0 |