NAME¶btrbk - backup tool for btrfs subvolumes
btrbk [-h|--help] [--version] [-c|--config <file>] [-n|--dry-run] [--exclude <filter>] [-p|--preserve] [--preserve-snapshots] [--preserve-backups] [-v|--verbose] [-q|--quiet] [-l|--loglevel <level>] [-t|--table] [-L|--long] [--format <output-format>] [--pretty] [-S|--print-schedule] [--progress] [--lockfile <file>] [--override <config_option>=<value>] <command> [<args>]
DESCRIPTION¶btrbk is a backup tool for btrfs subvolumes, taking advantage of btrfs specific capabilities to create atomic snapshots and transfer them incrementally to a target btrfs filesystem. It is able to perform backups from one source to multiple destinations.
For most operations, btrbk requires root privileges to run correctly. Alternatively, consider using "btrfs-progs-sudo" or "btrfs-progs-btrbk" backends, both of which allows you to run btrbk as a regular user. Refer to configuration option backend in btrbk.conf(5) for more details.
Snapshots and Backups¶Snapshots as well as backup subvolumes are created in form:
Where <snapshot-name> is identical to the source subvolume name, unless the configuration option snapshot_name is set. The <timestamp> is either "YYYYMMDD" or "YYYYMMDDThhmm" (dependent of the timestamp_format configuration option), where "YYYY" is the year, "MM" is the month, "DD" is the day, "hh" is the hour and "mm" is the minute of the creation time (local time of the host running btrbk). If multiple snapshots/backups are created on the same date/time, N will be incremented on each snapshot, starting at 1.
Note that snapshot is a btrfs terminology for a “read-only subvolume” (showing a parent-uuid, see btrfs-subvolume(8)); backup is a btrbk terminology for a “read-only subvolume created with send/receive” (showing a received-uuid).
-c, --config <file>
-l, --loglevel <level>
Actions¶The following commands are used to create snapshots and/or backups. All actions can operate in dry-run mode (-n, --dry-run). Use the --format command line option to switch between different output formats.
See section RETENTION POLICY in btrbk.conf(5) for information on configuring the retention policy.
Step 0: Read Data
Step 1: Create Snapshots
Step 2: Create Backups
Step 3: Delete Backups
Step 4: Delete Snapshots
Note that snapshot deletion is skipped if the target is not accessible, as it is still required in order to determine the latest snapshot/backup pair (which is always preserved, regardless of the retention policy).
Note that deletion is skipped if source or target is not accessible, as it is still required in order to determine the latest snapshot/backup pair (which is always preserved, regardless of the retention policy).
archive <source> <target> [--raw]
If you want to use nested subvolumes on the target filesystem, you need to create them by hand (e.g. by running "btrfs subvolume create <target>/dir"). Check the output of --dry-run if unsure.
Note that this feature needs a linux kernel >=4.4 to work correctly!
If --raw option is set, creates raw targets (experimental, see btrbk.conf(5), TARGET TYPES).
The following table gives a quick overview of the action commands and resulting snapshot creation (S+), backup creation (B+), snapshot deletion (S-), and backup deletion (B-):
Command Option S+ B+ S- B- -------------------------------------------- run x x x x run --preserve x x run --preserve-snapshots x x x run --preserve-backups x x x snapshot x x snapshot --preserve x resume x x x resume --preserve x resume --preserve-snapshots x x resume --preserve-backups x x prune x x prune --preserve-snapshots x prune --preserve-backups x
Informative Commands¶The following commands are informative only, and will not alter the file system.
list <subcommand> [filter...]
Use the --format command line option to switch between different output formats.
diff <from> <to>
FILTER STATEMENTS¶Filter arguments are accepted in form:
Accepted formats for <url> are:
Note that for run and snapshot commands, a filter matching a target configuration section also enables snapshot creation of the surrounding subvolume section. If this is not desired, consider running snapshot and resume commands separately.
EXIT STATUS¶btrbk returns the following error codes:
AVAILABILITY¶Please refer to the btrbk project page <https://digint.ch/btrbk/> for further details.
SEE ALSO¶btrbk.conf(5), btrfs(8)
For more information about btrfs and incremental backups, see the web site at <https://btrfs.wiki.kernel.org/index.php/Incremental_Backup>
AUTHOR¶Axel Burri < <email@example.com>>