mirror of https://github.com/digint/btrbk
Merge branch 'refactoring'
commit
01a25ad4df
18
ChangeLog
18
ChangeLog
|
@ -1,12 +1,24 @@
|
||||||
btrbk-current
|
btrbk-current
|
||||||
|
|
||||||
* Bugfix: allow "0" as subvolume name (closes: #10)
|
* New versioning scheme using more common three-level versions.
|
||||||
|
* Code refactoring: cleanup of data structures and handling of btrfs
|
||||||
|
subvolume tree, as well as security related code parts.
|
||||||
|
* Correct handling of symlinks to btrfs subvolumes (closes: #12).
|
||||||
|
* Added configuration option "snapshot_name" (closes: #5).
|
||||||
|
* Log messages now go to stderr, only the summary is printed on
|
||||||
|
stdout.
|
||||||
|
* Bugfix: allow "0" as subvolume name (closes: #10).
|
||||||
|
* Bugfix: allow "/" as volume name (closes: #15).
|
||||||
* Bugfix: check source AND targets for determining snapshot postfix
|
* Bugfix: check source AND targets for determining snapshot postfix
|
||||||
(closes: #11)
|
(closes: #11).
|
||||||
|
* Bugfix: fixed "diff" action (colses: #14).
|
||||||
|
* Allow '+' character for subvolume names.
|
||||||
|
* Filesystems on remote hosts are now printed as
|
||||||
|
"{my.remote-host.com}" in summary and logs.
|
||||||
|
|
||||||
btrbk-0.16
|
btrbk-0.16
|
||||||
|
|
||||||
* Bugfix: correctly check retention policy for missing backups
|
* Bugfix: correctly check retention policy for missing backups.
|
||||||
|
|
||||||
btrbk-0.15
|
btrbk-0.15
|
||||||
|
|
||||||
|
|
|
@ -1,15 +1,20 @@
|
||||||
#
|
#
|
||||||
# Example btrbk configuration file
|
# Example btrbk configuration file
|
||||||
#
|
#
|
||||||
# Note that the options can be overridden in the
|
|
||||||
# volume/subvolume/target sections. Refer to man btrbk.conf(5) for a
|
|
||||||
# more detailed explanation of this.
|
|
||||||
#
|
#
|
||||||
|
# Please refer to the btrbk.conf(5) man-page for more details.
|
||||||
|
#
|
||||||
|
# Note that the options can be overridden in the
|
||||||
|
# volume/subvolume/target sections.
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
# Directory in which the btrfs snapshots are created. Relative to
|
# Directory in which the btrfs snapshots are created. Relative to
|
||||||
# <volume-directory> of the volume section.
|
# <volume-directory> of the volume section.
|
||||||
# If not set, the snapshots are directly created in:
|
# If not set, the snapshots are created in <volume-directory>.
|
||||||
# <volume>/<volume-directory>
|
#
|
||||||
|
# If you want to set a custom name for the snapshot (and backups),
|
||||||
|
# use the "snapshot_name" option within the subvolume section.
|
||||||
#
|
#
|
||||||
# NOTE: btrbk does not autmatically create this directory, and the
|
# NOTE: btrbk does not autmatically create this directory, and the
|
||||||
# snapshot creation will fail if it is not present.
|
# snapshot creation will fail if it is not present.
|
||||||
|
@ -17,10 +22,10 @@
|
||||||
snapshot_dir _btrbk_snap
|
snapshot_dir _btrbk_snap
|
||||||
|
|
||||||
# Perform incremental backups (set to "strict" if you want to prevent
|
# Perform incremental backups (set to "strict" if you want to prevent
|
||||||
# creation of initial backups if no parent is found)
|
# creation of initial backups if no parent is found).
|
||||||
incremental yes
|
incremental yes
|
||||||
|
|
||||||
# Always create snapshots, even if the target volume is unreachable
|
# Always create snapshots, even if the target volume is unreachable.
|
||||||
snapshot_create_always yes
|
snapshot_create_always yes
|
||||||
|
|
||||||
# Resume missing backups if the target volume is reachable again.
|
# Resume missing backups if the target volume is reachable again.
|
||||||
|
@ -54,23 +59,22 @@ btrfs_commit_delete after
|
||||||
|
|
||||||
#
|
#
|
||||||
# Volume section: "volume <volume-directory>"
|
# Volume section: "volume <volume-directory>"
|
||||||
|
#
|
||||||
# <volume-directory> Directory of a btrfs volume (or subvolume)
|
# <volume-directory> Directory of a btrfs volume (or subvolume)
|
||||||
# containing the subvolume to be backuped
|
# containing the subvolume to be backuped
|
||||||
# (usually the mount-point of a btrfs filesystem
|
# (usually the mount-point of a btrfs filesystem
|
||||||
# mounted with subvolid=0 option)
|
# mounted with subvolid=0 option)
|
||||||
#
|
#
|
||||||
# Subvolume section: "subvolume <subvolume-name>
|
# Subvolume section: "subvolume <subvolume-name>
|
||||||
|
#
|
||||||
# <subvolume-name> Subvolume to be backuped, relative to
|
# <subvolume-name> Subvolume to be backuped, relative to
|
||||||
# <volume-directory> in volume section
|
# <volume-directory> in volume section.
|
||||||
#
|
#
|
||||||
# Target section: "target <type> <volume-directory>"
|
# Target section: "target <type> <volume-directory>"
|
||||||
|
|
||||||
# <type> Backup type, currently only "send-receive"
|
|
||||||
|
|
||||||
# <volume-directory> Directory of a btrfs volume (or subvolume)
|
|
||||||
# receiving the backups
|
|
||||||
#
|
#
|
||||||
|
# <type> Backup type, currently only "send-receive".
|
||||||
|
# <volume-directory> Directory of a btrfs volume (or subvolume)
|
||||||
|
# receiving the backups.
|
||||||
#
|
#
|
||||||
# NOTE: The parser does not care about indentation, this is only for
|
# NOTE: The parser does not care about indentation, this is only for
|
||||||
# human readability. The options always apply to the last section
|
# human readability. The options always apply to the last section
|
||||||
|
@ -83,7 +87,6 @@ volume /mnt/btr_system
|
||||||
subvolume root_gentoo
|
subvolume root_gentoo
|
||||||
target send-receive /mnt/btr_ext/_btrbk
|
target send-receive /mnt/btr_ext/_btrbk
|
||||||
target send-receive /mnt/btr_backup/_btrbk
|
target send-receive /mnt/btr_backup/_btrbk
|
||||||
receive_log sidecar
|
|
||||||
|
|
||||||
subvolume kvm
|
subvolume kvm
|
||||||
# use different preserve matrix for kvm backups
|
# use different preserve matrix for kvm backups
|
||||||
|
@ -106,14 +109,9 @@ volume /mnt/btr_ext
|
||||||
subvolume data
|
subvolume data
|
||||||
target send-receive /mnt/btr_backup/_btrbk
|
target send-receive /mnt/btr_backup/_btrbk
|
||||||
|
|
||||||
volume /mnt/btr_boot
|
|
||||||
incremental yes
|
|
||||||
|
|
||||||
subvolume boot
|
|
||||||
target send-receive /mnt/btr_ext/_btrbk
|
|
||||||
target send-receive /mnt/btr_backup/_btrbk
|
|
||||||
|
|
||||||
|
|
||||||
volume ssh://my-remote-host.com/mnt/btr_pool
|
volume ssh://my-remote-host.com/mnt/btr_pool
|
||||||
subvolume system
|
subvolume data_0
|
||||||
|
snapshot_dir snapshots/btrbk
|
||||||
|
snapshot_name data_main
|
||||||
target send-receive /mnt/btr_backup/_btrbk/my-remote-host.com
|
target send-receive /mnt/btr_backup/_btrbk/my-remote-host.com
|
||||||
|
|
|
@ -13,15 +13,16 @@ generated. The retention policy as well as other options can be
|
||||||
defined for each backup.
|
defined for each backup.
|
||||||
.PP
|
.PP
|
||||||
The options specified always apply to the last section encountered,
|
The options specified always apply to the last section encountered,
|
||||||
overriding the same option of the next higher section. This means that
|
superseding the values set in upper-level sections. This means that
|
||||||
global options must be set before any sections are defined.
|
global options must be set before any sections are defined.
|
||||||
.PP
|
.PP
|
||||||
The sections are:
|
The sections are:
|
||||||
.TP
|
.TP
|
||||||
\fBvolume\fR <volume-directory>|<url>
|
\fBvolume\fR <volume-directory>|<url>
|
||||||
Directory of a btrfs volume (or subvolume) containing the source
|
Directory of a btrfs volume containing the source subvolume(s) to be
|
||||||
subvolume(s) to be backuped (usually the mount-point of a btrfs
|
backuped. \fI<volume-directory>\fR must be an absolute path and point
|
||||||
filesystem mounted with the \fIsubvolid=0\fR option).
|
to a btrfs volume (or subvolume). Usually the mount point of a btrfs
|
||||||
|
filesystem mounted with the \fIsubvolid=0\fR option.
|
||||||
.TP
|
.TP
|
||||||
\fBsubvolume\fR <subvolume-name>
|
\fBsubvolume\fR <subvolume-name>
|
||||||
Subvolume to be backuped, relative to the \fI<volume-directory>\fR
|
Subvolume to be backuped, relative to the \fI<volume-directory>\fR
|
||||||
|
@ -29,8 +30,9 @@ specified in the \fIvolume\fR section.
|
||||||
.TP
|
.TP
|
||||||
\fBtarget\fR <type> <volume-directory>|<url>
|
\fBtarget\fR <type> <volume-directory>|<url>
|
||||||
Target type and directory where the backup subvolumes are to be
|
Target type and directory where the backup subvolumes are to be
|
||||||
created. In the current version of btrbk, the only valid \fI<type>\fR
|
created. \fI<volume-directory>\fR must be an absolute path and point
|
||||||
is \(lqsend\-receive\(rq.
|
to a btrfs volume (or subvolume). Currently the the only valid
|
||||||
|
\fI<type>\fR is \(lqsend\-receive\(rq.
|
||||||
.PP
|
.PP
|
||||||
For the \fIvolume\fR and \fItarget\fR sections, you can also specify a
|
For the \fIvolume\fR and \fItarget\fR sections, you can also specify a
|
||||||
ssh-url instead of a local directory. The syntax for \fI<url>\fR is:
|
ssh-url instead of a local directory. The syntax for \fI<url>\fR is:
|
||||||
|
@ -38,20 +40,21 @@ ssh-url instead of a local directory. The syntax for \fI<url>\fR is:
|
||||||
ssh://host.xz/path/to/volume
|
ssh://host.xz/path/to/volume
|
||||||
.PP
|
.PP
|
||||||
Note that btrfs is very picky on file names (mainly for security
|
Note that btrfs is very picky on file names (mainly for security
|
||||||
reasons), only the characters [0-9] [a-z] [A-Z] and "._-@" are
|
reasons), only the characters [0-9] [a-z] [A-Z] and "._+-@" are
|
||||||
allowed.
|
allowed.
|
||||||
.PP
|
.PP
|
||||||
The configuration options are:
|
The configuration options are:
|
||||||
.TP
|
.TP
|
||||||
\fBsnapshot_dir\fR <directory>
|
\fBsnapshot_dir\fR <directory>
|
||||||
Directory in which the btrfs snapshots are created. Relative to
|
Directory in which the btrfs snapshots are created, relative to
|
||||||
\fI<volume-directory>\fR of the \fIvolume\fR section. Note that btrbk
|
\fI<volume-directory>\fR of the \fIvolume\fR section. Note that btrbk
|
||||||
does not autmatically create this directory, and the snapshot creation
|
does not autmatically create this directory, and the snapshot creation
|
||||||
will fail if it is not present.
|
will fail if it is not present.
|
||||||
.TP
|
.TP
|
||||||
\fBincremental\fR yes|no|strict
|
\fBsnapshot_name\fR <basename>
|
||||||
Perform incremental backups. Defaults to \(lqyes\(rq. If set to
|
Base name of the created snapshot (and backup). Defaults to
|
||||||
\(lqstrict\(rq, non-incremental (initial) backups are never created.
|
\fI<subvolume-name>\fR. This option is only valid in the \fItarget\fR
|
||||||
|
section.
|
||||||
.TP
|
.TP
|
||||||
\fBsnapshot_create_always\fR yes|no
|
\fBsnapshot_create_always\fR yes|no
|
||||||
If set, the snapshots are always created, even if the backup subvolume
|
If set, the snapshots are always created, even if the backup subvolume
|
||||||
|
@ -62,6 +65,10 @@ is reachable again. Useful for laptop filesystems in order to make
|
||||||
sure the snapshots are created even if you are on the road. Defaults
|
sure the snapshots are created even if you are on the road. Defaults
|
||||||
to \(lqno\(rq.
|
to \(lqno\(rq.
|
||||||
.TP
|
.TP
|
||||||
|
\fBincremental\fR yes|no|strict
|
||||||
|
Perform incremental backups. Defaults to \(lqyes\(rq. If set to
|
||||||
|
\(lqstrict\(rq, non-incremental (initial) backups are never created.
|
||||||
|
.TP
|
||||||
\fBresume_missing\fR yes|no
|
\fBresume_missing\fR yes|no
|
||||||
If set, the backups in the target directory are compared to the source
|
If set, the backups in the target directory are compared to the source
|
||||||
snapshots, and missing backups are created if needed (complying to the
|
snapshots, and missing backups are created if needed (complying to the
|
||||||
|
|
|
@ -40,8 +40,6 @@ case "$SSH_ORIGINAL_COMMAND" in
|
||||||
/sbin/btrfs\ receive\ *) run_cmd ;; # mandatory if this host is backup target
|
/sbin/btrfs\ receive\ *) run_cmd ;; # mandatory if this host is backup target
|
||||||
/sbin/btrfs\ subvolume\ delete\ *) run_cmd ;; # mandatory if scheduling is active
|
/sbin/btrfs\ subvolume\ delete\ *) run_cmd ;; # mandatory if scheduling is active
|
||||||
/sbin/btrfs\ subvolume\ find-new\ *) run_cmd ;; # needed for "btrbk diff"
|
/sbin/btrfs\ subvolume\ find-new\ *) run_cmd ;; # needed for "btrbk diff"
|
||||||
/sbin/btrfs\ filesystem\ show\ *) run_cmd ;; # needed for "btrbk info"
|
|
||||||
/sbin/btrfs\ filesystem\ df\ *) run_cmd ;; # needed for "btrbk info"
|
|
||||||
/sbin/btrfs\ filesystem\ usage\ *) run_cmd ;; # needed for "btrbk info"
|
/sbin/btrfs\ filesystem\ usage\ *) run_cmd ;; # needed for "btrbk info"
|
||||||
*) reject_and_die ;;
|
*) reject_and_die ;;
|
||||||
esac
|
esac
|
||||||
|
|
Loading…
Reference in New Issue