LinuxCommandLibrary

btrbk

Backup and restore Btrfs subvolumes

TLDR

Print statistics about configured subvolumes and snapshots

$ sudo btrbk stats
copy

List configured subvolumes and snapshots
$ sudo btrbk list
copy

Print what would happen in a run without making the displayed changes
$ sudo btrbk --verbose dryrun
copy

Run backup routines verbosely, show progress bar
$ sudo btrbk --progress --verbose run
copy

Only create snapshots for configured subvolumes
$ sudo btrbk snapshot
copy

SYNOPSIS

btrbk [options] [config_file]

PARAMETERS

-c config_file
    Specify the configuration file to use. Defaults to /etc/btrbk/btrbk.conf.

-d
    Dry-run mode. Simulates the backup process without actually modifying anything.

-q
    Quiet mode. Suppresses most output.

-v
    Verbose mode. Increases output verbosity. Can be used multiple times.

--version
    Display version information and exit.

--no-lock
    Disable locking mechanism.

--help
    Display help message and exit.

DESCRIPTION

btrbk is a tool for creating, managing, and rotating snapshots and backups of Btrfs subvolumes. It allows you to define backup configurations with retention policies, allowing for automated periodic backups to local or remote destinations using SSH. btrbk is designed to be simple to configure and use, focusing on efficiency and reliability. It supports various backup modes, including incremental backups, and provides detailed logging for monitoring backup operations. Key features include support for multiple backup targets, customizable snapshot naming, and pre/post backup hooks for executing custom scripts. It provides different target modes like target directory, target subvolume or even remote SSH.

CAVEATS

btrbk relies on the Btrfs filesystem. Make sure that the filesystem has enough free space to create snapshots. SSH backups require key-based authentication to avoid password prompts.

CONFIGURATION

The configuration file (typically /etc/btrbk/btrbk.conf) defines backup sources, destinations, and retention policies. The syntax is key-value pairs, and examples are provided with the btrbk package. Proper configuration is essential for btrbk to function correctly.
Example Target Configuration:
target[target_ssh]:/backup/btrbk/
type ssh
user backupuser
host backup.example.com

RETENTION POLICIES

Retention policies define how many snapshots or backups to keep. This is configured in the btrbk configuration file with parameters like 'retain-daily', 'retain-weekly', and 'retain-monthly'. btrbk automatically deletes older snapshots/backups based on these settings to manage disk space.

HISTORY

btrbk was developed as a solution for easily managing Btrfs snapshots and backups. It gained popularity due to its simple configuration and effective features. Development continues with updates including feature additions and bug fixes.

SEE ALSO

btrfs(8), ssh(1)

Copied to clipboard