Btrbk

btrbk is Article description::a tool for creating incremental snapshots and remote backups of Btrfs subvolumes. It is used for simple backups to an external hard drive as well as more complex scenarios, like a server pulling the backups from all computers in the network or just to make local snapshots to protect against accidental deletions.

Terminology
Snapshots are locally (on the same filesystem) stored Btrfs snapshots, backups are snapshots copied to a folder or over SSH and archives are extra copies of backups.

Configuration
A commented example configuration file is found in. Refer to the man page for more details.

With the example configuration above, btrbk will only create snapshots (in ) if the data has changed. The long timestamps include the time in addition to the date.

The *_preserve* keywords mean that:


 * Snapshots are kept for 7 days, up to 24 hourly and 7 daily snapshots
 * There will be no hourly backups stored, daily backups will be deleted after 14 days, weekly backups after 6 weeks, monthly backups after 4 months and yearly backups after 1 year
 * When archiving a backup, only 1 daily, weekly, monthly and yearly snapshot will be kept
 * The newest snapshot/backup/archive will always be kept, because *_preserve_min is set to latest

The example assumes that the btrfs subvolume containing @root and @home is mounted at. This is usually the btrfs root subvolume, which always has subvolid=5.

Create the directory for the snapshots and test the configuration:

Backups
To be able to create backups, add a target :

Pull backups from remote computers
This is an example configuration for multiple clients to backup onto a server:

For more examples, take a look at the official documentation hyperlinked at the top right of this page.

SSH configuration
To backup to or from a remote computer via SSH, generate a key and add it to on the targets.

To restrict the IPs/IP ranges from where root can log in, use the Match keyword. Consult the man page for sshd_config for details.

Usage
To create snapshots and backup (if a target was configured), run:

To only create snapshots even if a target is configured, run: