2015-03-13 14:44:09 +01:00
|
|
|
#
|
2015-01-17 13:53:23 +01:00
|
|
|
# Example btrbk configuration file
|
2015-03-13 14:44:09 +01:00
|
|
|
#
|
2015-04-28 19:22:15 +02:00
|
|
|
#
|
|
|
|
# Please refer to the btrbk.conf(5) man-page for more details.
|
|
|
|
#
|
2015-03-13 14:44:09 +01:00
|
|
|
# Note that the options can be overridden in the
|
2015-04-28 19:22:15 +02:00
|
|
|
# volume/subvolume/target sections.
|
2015-03-13 14:44:09 +01:00
|
|
|
#
|
2015-01-17 13:53:23 +01:00
|
|
|
|
2015-04-28 19:22:15 +02:00
|
|
|
|
2015-03-13 14:44:09 +01:00
|
|
|
# Directory in which the btrfs snapshots are created. Relative to
|
|
|
|
# <volume-directory> of the volume section.
|
2015-04-28 19:22:15 +02:00
|
|
|
# If not set, the snapshots are created in <volume-directory>.
|
|
|
|
#
|
|
|
|
# If you want to set a custom name for the snapshot (and backups),
|
|
|
|
# use the "snapshot_name" option within the subvolume section.
|
2015-03-13 14:44:09 +01:00
|
|
|
#
|
|
|
|
# NOTE: btrbk does not autmatically create this directory, and the
|
|
|
|
# snapshot creation will fail if it is not present.
|
|
|
|
#
|
2015-01-17 13:53:23 +01:00
|
|
|
snapshot_dir _btrbk_snap
|
|
|
|
|
2015-05-27 15:39:56 +02:00
|
|
|
# Always create snapshots. Set this to "ondemand" to only create
|
|
|
|
# snapshots if the target volume is reachable. Set this to "no" if
|
|
|
|
# snapshot creation is done by another instance of btrbk.
|
|
|
|
#snapshot_create always
|
|
|
|
|
2015-01-17 14:55:46 +01:00
|
|
|
# Perform incremental backups (set to "strict" if you want to prevent
|
2015-05-20 21:51:20 +02:00
|
|
|
# creation of non-incremental backups if no parent is found).
|
2015-05-27 15:39:56 +02:00
|
|
|
#incremental yes
|
2015-01-17 13:53:23 +01:00
|
|
|
|
2015-05-27 15:39:56 +02:00
|
|
|
# Resume missing backups (set to "no" if you don't want to resume
|
|
|
|
# missing backups).
|
|
|
|
#resume_missing yes
|
2015-03-31 13:42:45 +02:00
|
|
|
|
2015-05-27 15:39:56 +02:00
|
|
|
# Specify on which day of week weekly/monthly backups are to be
|
|
|
|
# preserved.
|
|
|
|
#preserve_day_of_week sunday
|
2015-03-31 13:42:45 +02:00
|
|
|
|
2015-05-27 15:39:56 +02:00
|
|
|
# Preserve matrix for source snapshots:
|
|
|
|
#snapshot_preserve_daily all
|
|
|
|
#snapshot_preserve_weekly 0
|
|
|
|
#snapshot_preserve_monthly all
|
2015-01-17 13:53:23 +01:00
|
|
|
|
2015-05-27 15:39:56 +02:00
|
|
|
# Preserve matrix for backup targets:
|
|
|
|
#target_preserve_daily all
|
|
|
|
#target_preserve_weekly 0
|
|
|
|
#target_preserve_monthly all
|
2015-01-17 13:53:23 +01:00
|
|
|
|
2015-05-27 15:39:56 +02:00
|
|
|
# Specify SSH private key for "ssh://" volumes / targets:
|
|
|
|
#ssh_identity /etc/btrbk/ssh/id_ed25519
|
|
|
|
#ssh_user root
|
2015-08-13 21:39:07 +02:00
|
|
|
#ssh_port default
|
2015-09-01 00:43:14 +02:00
|
|
|
#ssh_compression no
|
2015-09-20 18:32:19 +02:00
|
|
|
#ssh_cipher_spec default
|
2015-01-17 13:53:23 +01:00
|
|
|
|
2015-05-27 15:39:56 +02:00
|
|
|
# Don't wait for transaction commit on deletion. Set this to "after"
|
|
|
|
# or "each" to make sure the deletion of subvolumes is committed to
|
|
|
|
# disk when btrbk terminates.
|
|
|
|
#btrfs_commit_delete no
|
2015-01-17 13:53:23 +01:00
|
|
|
|
2015-05-27 15:39:56 +02:00
|
|
|
# Set this to "yes" to enable btrfs-progs < 3.17 compatibility.
|
2015-03-24 13:13:00 +01:00
|
|
|
# Set this either globally or in a specific "target" section.
|
2015-05-27 15:39:56 +02:00
|
|
|
#btrfs_progs_compat no
|
2015-03-24 13:13:00 +01:00
|
|
|
|
2015-10-13 18:24:30 +02:00
|
|
|
# Enable transaction log
|
|
|
|
#transaction_log /var/log/btrbk_transaction.log
|
|
|
|
|
2015-01-17 14:55:46 +01:00
|
|
|
|
|
|
|
#
|
2015-03-13 14:44:09 +01:00
|
|
|
# Volume section: "volume <volume-directory>"
|
2015-04-28 19:22:15 +02:00
|
|
|
#
|
|
|
|
# <volume-directory> Directory of a btrfs volume (or subvolume)
|
|
|
|
# containing the subvolume to be backuped
|
|
|
|
# (usually the mount-point of a btrfs filesystem
|
|
|
|
# mounted with subvolid=0 option)
|
2015-01-17 13:53:23 +01:00
|
|
|
#
|
2015-03-13 14:44:09 +01:00
|
|
|
# Subvolume section: "subvolume <subvolume-name>
|
2015-04-28 19:22:15 +02:00
|
|
|
#
|
|
|
|
# <subvolume-name> Subvolume to be backuped, relative to
|
|
|
|
# <volume-directory> in volume section.
|
2015-01-17 14:55:46 +01:00
|
|
|
#
|
2015-03-13 14:44:09 +01:00
|
|
|
# Target section: "target <type> <volume-directory>"
|
2015-01-17 14:55:46 +01:00
|
|
|
#
|
2015-04-28 19:22:15 +02:00
|
|
|
# <type> Backup type, currently only "send-receive".
|
|
|
|
# <volume-directory> Directory of a btrfs volume (or subvolume)
|
|
|
|
# receiving the backups.
|
2015-01-17 14:55:46 +01:00
|
|
|
#
|
|
|
|
# NOTE: The parser does not care about indentation, this is only for
|
|
|
|
# human readability. The options always apply to the last section
|
|
|
|
# encountered, overriding the corresponding option of the upper
|
|
|
|
# section. This means that the global options must be set before any
|
|
|
|
# "volume" section.
|
2015-01-17 13:53:23 +01:00
|
|
|
#
|
|
|
|
|
2015-05-27 15:39:56 +02:00
|
|
|
|
|
|
|
#
|
|
|
|
# Example configuration:
|
|
|
|
#
|
|
|
|
snapshot_preserve_daily 14
|
|
|
|
snapshot_preserve_weekly 0
|
|
|
|
snapshot_preserve_monthly 0
|
|
|
|
|
|
|
|
target_preserve_daily 20
|
|
|
|
target_preserve_weekly 10
|
|
|
|
target_preserve_monthly all
|
|
|
|
|
|
|
|
|
|
|
|
# Backup to external disk mounted on /mnt/btr_backup
|
|
|
|
volume /mnt/btr_pool
|
|
|
|
# no action if external disk is not attached
|
|
|
|
snapshot_create ondemand
|
|
|
|
|
2015-01-17 13:53:23 +01:00
|
|
|
subvolume root_gentoo
|
2015-05-27 15:39:56 +02:00
|
|
|
target send-receive /mnt/btr_backup/_btrbk
|
2015-01-17 13:53:23 +01:00
|
|
|
|
|
|
|
subvolume kvm
|
|
|
|
# use different preserve matrix for kvm backups
|
2015-05-27 15:39:56 +02:00
|
|
|
target_preserve_daily 7
|
|
|
|
target_preserve_weekly 4
|
2015-01-17 13:53:23 +01:00
|
|
|
|
2015-05-27 15:39:56 +02:00
|
|
|
target send-receive /mnt/btr_backup/_btrbk
|
2015-01-17 13:53:23 +01:00
|
|
|
|
|
|
|
|
2015-05-27 15:39:56 +02:00
|
|
|
# Backup to external disk as well as some remote host
|
2015-01-17 13:53:23 +01:00
|
|
|
volume /mnt/btr_data
|
|
|
|
subvolume home
|
2015-05-27 15:39:56 +02:00
|
|
|
# always create snapshot, even if targets are unreachable
|
|
|
|
snapshot_create always
|
|
|
|
target send-receive /mnt/btr_backup/_btrbk
|
|
|
|
target send-receive ssh://backup.my-remote-host.com/mnt/btr_backup
|
2015-01-17 13:53:23 +01:00
|
|
|
|
|
|
|
|
2015-05-27 15:39:56 +02:00
|
|
|
# Backup from remote host, with different naming
|
2015-01-17 13:53:23 +01:00
|
|
|
volume ssh://my-remote-host.com/mnt/btr_pool
|
2015-04-28 19:22:15 +02:00
|
|
|
subvolume data_0
|
2015-05-27 15:39:56 +02:00
|
|
|
snapshot_dir snapshots/btrbk
|
|
|
|
snapshot_name data_main
|
|
|
|
target send-receive /mnt/btr_backup/_btrbk/my-remote-host.com
|
2015-05-20 21:51:20 +02:00
|
|
|
|
|
|
|
|
|
|
|
# Resume backups from remote host which runs its own btrbk instance
|
|
|
|
# creating snapshots for "home" in "/mnt/btr_pool/btrbk_snapshots".
|
|
|
|
volume ssh://my-remote-host.com/mnt/btr_pool
|
|
|
|
subvolume home
|
2015-05-27 15:39:56 +02:00
|
|
|
snapshot_dir btrbk_snapshots
|
2015-05-20 21:51:20 +02:00
|
|
|
snapshot_preserve_daily all
|
|
|
|
snapshot_create no
|
|
|
|
resume_missing yes
|
2015-05-27 15:39:56 +02:00
|
|
|
target send-receive /mnt/btr_backup/_btrbk/my-remote-host.com
|