2015-09-02 12:27:13 +02:00
|
|
|
.TH "btrbk" "1" "2015-09-02" "btrbk v0.20.0" ""
|
2015-09-03 18:02:19 +02:00
|
|
|
.\" disable hyphenation
|
|
|
|
.nh
|
|
|
|
.\" disable justification (adjust text to left margin only)
|
|
|
|
.ad l
|
2015-02-08 13:43:29 +01:00
|
|
|
.SH NAME
|
|
|
|
btrbk \- backup tool for btrfs volumes
|
|
|
|
.SH SYNOPSIS
|
2015-09-03 18:02:19 +02:00
|
|
|
.nf
|
2015-09-03 18:13:09 +02:00
|
|
|
\fBbtrbk\fR [\-h|\-\-help] [\-\-version] [\-c|\-\-config <file>]
|
|
|
|
[\-p|\-\-preserve] [\-r|\-\-resume\-only]
|
|
|
|
[\-v|\-\-verbose] [\-q|\-\-quiet] [\-l|\-\-loglevel <level>] [\-\-progress]
|
|
|
|
<command> [<args>]
|
2015-09-03 18:02:19 +02:00
|
|
|
.fi
|
2015-02-08 13:43:29 +01:00
|
|
|
.SH DESCRIPTION
|
|
|
|
\fBbtrbk\fR is a backup tool for btrfs subvolumes, taking advantage of
|
|
|
|
btrfs specific capabilities to create atomic snapshots and transfer
|
|
|
|
them incrementally to target volumes. It is able to perform backups
|
|
|
|
from one source to multiple destinations.
|
|
|
|
.PP
|
|
|
|
Snapshots as well as backup subvolume names are created in form:
|
2015-09-03 18:02:19 +02:00
|
|
|
.PP
|
|
|
|
.RS 4
|
2015-02-08 13:43:29 +01:00
|
|
|
<source_name>.YYYYMMDD[_N]
|
2015-09-03 18:02:19 +02:00
|
|
|
.RE
|
2015-02-08 13:43:29 +01:00
|
|
|
.PP
|
|
|
|
Where YYYY is the year, MM is the month, and DD is the day of
|
|
|
|
creation, and, if multiple backups are created on the same day, N will
|
|
|
|
be incremented on each backup, starting at 1.
|
|
|
|
.SH OPTIONS
|
2015-09-03 18:02:19 +02:00
|
|
|
.PP
|
2015-09-03 18:13:09 +02:00
|
|
|
\-h, \-\-help
|
2015-09-03 18:02:19 +02:00
|
|
|
.RS 4
|
2015-09-03 18:13:09 +02:00
|
|
|
Prints the synopsis and a list of the commands.
|
2015-09-03 18:02:19 +02:00
|
|
|
.RE
|
|
|
|
.PP
|
2015-09-03 18:13:09 +02:00
|
|
|
\-\-version
|
2015-09-03 18:02:19 +02:00
|
|
|
.RS 4
|
2015-09-03 18:13:09 +02:00
|
|
|
Prints the btrbk version.
|
2015-09-03 18:02:19 +02:00
|
|
|
.RE
|
|
|
|
.PP
|
2015-08-15 17:51:00 +02:00
|
|
|
\-c, \-\-config <file>
|
2015-09-03 18:02:19 +02:00
|
|
|
.RS 4
|
2015-02-08 13:43:29 +01:00
|
|
|
Read the configuration from <file>.
|
2015-09-03 18:02:19 +02:00
|
|
|
.RE
|
|
|
|
.PP
|
2015-08-15 17:51:00 +02:00
|
|
|
\-p, \-\-preserve
|
2015-09-03 18:02:19 +02:00
|
|
|
.RS 4
|
2015-02-28 12:02:28 +01:00
|
|
|
Preserve all backups. Skips deletion of old backups, even if specified
|
|
|
|
in the configuration file.
|
2015-09-03 18:02:19 +02:00
|
|
|
.RE
|
|
|
|
.PP
|
2015-08-15 17:51:00 +02:00
|
|
|
\-r, \-\-resume-only
|
2015-09-03 18:02:19 +02:00
|
|
|
.RS 4
|
2015-08-13 22:17:01 +02:00
|
|
|
Resume only. Skips snapshot creation, only resumes missing
|
|
|
|
backups. This only makes sense if the \fIresume_missing\fR option is
|
|
|
|
set to \[lq]yes\[rq] in the configuration file.
|
2015-09-03 18:02:19 +02:00
|
|
|
.RE
|
|
|
|
.PP
|
2015-08-15 17:51:00 +02:00
|
|
|
\-v, \-\-verbose
|
2015-09-03 18:02:19 +02:00
|
|
|
.RS 4
|
2015-02-08 13:43:29 +01:00
|
|
|
Verbose output. Identical to: \-l info.
|
2015-09-03 18:02:19 +02:00
|
|
|
.RE
|
|
|
|
.PP
|
2015-08-15 17:51:00 +02:00
|
|
|
\-q, \-\-quiet
|
2015-09-03 18:02:19 +02:00
|
|
|
.RS 4
|
2015-02-08 13:43:29 +01:00
|
|
|
Quiet operation. If set, btrbk does not print the summary after
|
|
|
|
executing the "run" command.
|
2015-09-03 18:02:19 +02:00
|
|
|
.RE
|
|
|
|
.PP
|
2015-08-15 17:51:00 +02:00
|
|
|
\-l, \-\-loglevel <level>
|
2015-09-03 18:02:19 +02:00
|
|
|
.RS 4
|
2015-02-08 13:43:29 +01:00
|
|
|
Set the level of verbosity. Accepted levels are warn, info, debug,
|
|
|
|
and trace.
|
2015-09-03 18:02:19 +02:00
|
|
|
.RE
|
|
|
|
.PP
|
2015-09-24 00:39:29 +02:00
|
|
|
\-\-raw\-output
|
|
|
|
.RS 4
|
|
|
|
Print raw (machine-readable) output. Changes output format for
|
|
|
|
\fBrun\fR, \fBdryrun\fR and \fBtree\fR. Useful for further scripting.
|
|
|
|
.RE
|
|
|
|
.PP
|
2015-08-15 18:23:48 +02:00
|
|
|
\-\-progress
|
2015-09-03 18:02:19 +02:00
|
|
|
.RS 4
|
2015-08-15 18:23:48 +02:00
|
|
|
Show progress bar on send-receive operation.
|
2015-09-03 18:02:19 +02:00
|
|
|
.RE
|
2015-02-08 13:43:29 +01:00
|
|
|
.SH COMMANDS
|
|
|
|
.PP
|
|
|
|
.B run
|
2015-09-20 17:47:46 +02:00
|
|
|
[filter...]
|
2015-02-08 13:43:29 +01:00
|
|
|
.RS 4
|
2015-03-01 14:28:26 +01:00
|
|
|
Perform backup operations as specified in the configuration file. If
|
2015-09-20 17:47:46 +02:00
|
|
|
the optional [filter...] arguments are present, backups are only
|
|
|
|
performed for the subvolumes/targets matching a \fIFILTER STATEMENT\fR
|
|
|
|
(see below).
|
2015-02-08 13:43:29 +01:00
|
|
|
.PP
|
2015-03-19 13:16:58 +01:00
|
|
|
First, btrbk reads information from the source and target btrfs
|
2015-05-20 13:46:09 +02:00
|
|
|
filesystems in order to perform sanity checks and identify
|
|
|
|
parent/child and received-from relationships.
|
2015-02-08 13:43:29 +01:00
|
|
|
.PP
|
|
|
|
If the checks succeed, btrbk creates snapshots for all the source
|
|
|
|
subvolumes specified in the configuration file.
|
|
|
|
.PP
|
2015-05-20 13:46:09 +02:00
|
|
|
Then, for each specified target, btrbk creates the backups as follows:
|
|
|
|
If the \fIresume_missing\fR option is set (the default), btrbk
|
|
|
|
transfers all missing snapshots needed to satisfy the configured
|
|
|
|
\fItarget_preserve_{daily,weekly,monthly}\fR retention policy, always
|
2015-05-25 17:13:36 +02:00
|
|
|
incrementally from the latest common parent subvolume found. If no
|
2015-05-20 13:46:09 +02:00
|
|
|
common parent subvolume is found, a full backup is created for the
|
|
|
|
first transfer. Note that the latest snapshot (the one created in the
|
|
|
|
first step) is always transferred, regardless of the retention policy.
|
2015-02-08 13:43:29 +01:00
|
|
|
.PP
|
2015-05-25 17:13:36 +02:00
|
|
|
As a last step, unless the -p (preserve backups) option is set,
|
2015-05-20 13:46:09 +02:00
|
|
|
snapshots and backup subvolumes that are not preserved by their
|
|
|
|
configured retention policy will be deleted. Note that the latest
|
|
|
|
snapshot as well as the latest backup is always preserved, regardless
|
|
|
|
of the retention policy.
|
2015-09-24 00:39:29 +02:00
|
|
|
.PP
|
|
|
|
If the \-\-raw\-output command line option is set, print the output in
|
|
|
|
the following format:
|
|
|
|
.PP
|
|
|
|
.RS 4
|
|
|
|
snapshot <snapshot-url> <src-subvol-url>
|
|
|
|
...
|
|
|
|
.RE
|
|
|
|
.RS 4
|
|
|
|
receive <target-url> <src-subvol-url> [<parent-subvol-url>]
|
|
|
|
...
|
|
|
|
.RE
|
|
|
|
.RS 4
|
|
|
|
delete <target-url>
|
|
|
|
...
|
|
|
|
.RE
|
|
|
|
.RS 4
|
|
|
|
aborted [volume|subvolume|target] <url> -- abort_reason
|
|
|
|
...
|
|
|
|
.RE
|
2015-02-08 13:43:29 +01:00
|
|
|
.RE
|
|
|
|
.PP
|
|
|
|
.B dryrun
|
2015-09-20 17:47:46 +02:00
|
|
|
[filter...]
|
2015-02-08 13:43:29 +01:00
|
|
|
.RS 4
|
|
|
|
Don't run btrfs commands, just show the snapshots and backup
|
2015-03-19 13:16:58 +01:00
|
|
|
subvolumes that would be created/deleted by the \fBrun\fR command. Use
|
|
|
|
in conjunction with \fI\-l debug\fR to see the btrfs commands that
|
|
|
|
would be executed.
|
2015-02-08 13:43:29 +01:00
|
|
|
.RE
|
|
|
|
.PP
|
|
|
|
.B info
|
2015-09-20 17:47:46 +02:00
|
|
|
[filter...]
|
2015-02-08 13:43:29 +01:00
|
|
|
.RS 4
|
2015-05-27 15:00:25 +02:00
|
|
|
Print filesystem usage information for all source/target
|
2015-09-20 17:47:46 +02:00
|
|
|
volumes. Optionally filtered by [filter...] arguments (see \fIFILTER
|
|
|
|
STATEMENTS\fR below).
|
2015-02-08 13:43:29 +01:00
|
|
|
.RE
|
|
|
|
.PP
|
|
|
|
.B tree
|
2015-09-20 17:47:46 +02:00
|
|
|
[filter...]
|
2015-02-08 13:43:29 +01:00
|
|
|
.RS 4
|
|
|
|
Print the snapshots and their corresponding backup subvolumes as a
|
2015-09-20 17:47:46 +02:00
|
|
|
tree. Optionally filtered by [filter...] arguments (see \fIFILTER
|
|
|
|
STATEMENTS\fR below).
|
2015-09-24 00:39:29 +02:00
|
|
|
.PP
|
|
|
|
If the \-\-raw\-output command line option is set, print the output in
|
|
|
|
the following format:
|
|
|
|
.PP
|
|
|
|
.RS 4
|
|
|
|
<subvol-url> <snapshot-url> <received-from-url>
|
|
|
|
...
|
|
|
|
.RE
|
2015-02-08 13:43:29 +01:00
|
|
|
.RE
|
|
|
|
.PP
|
|
|
|
.B origin
|
|
|
|
<subvolume>
|
|
|
|
.RS 4
|
|
|
|
Print origin information for the given backup subvolume, showing the
|
|
|
|
parent-child relationship as well as the received-from information.
|
|
|
|
.RE
|
|
|
|
.PP
|
|
|
|
.B diff
|
|
|
|
<from> <to>
|
|
|
|
.RS 4
|
|
|
|
Print new files since subvolume <from> for subvolume <to>.
|
|
|
|
.RE
|
2015-09-20 17:47:46 +02:00
|
|
|
.SH FILTER STATEMENTS
|
|
|
|
Filter arguments are accepted in form:
|
|
|
|
.PP
|
|
|
|
[hostname:]<volume-directory>
|
|
|
|
.RS 4
|
|
|
|
Matches all subvolumes and targets of a \fIvolume\fR configuration section.
|
|
|
|
.RE
|
|
|
|
.PP
|
|
|
|
[hostname:]<volume-directory>/<subvolume-name>
|
|
|
|
.RS 4
|
|
|
|
Matches the specified subvolume and all targets of a \fIsubvolume\fR
|
|
|
|
configuration section.
|
|
|
|
.RE
|
|
|
|
.PP
|
|
|
|
[hostname:]<target-directory>
|
|
|
|
.RS 4
|
2015-09-24 14:56:22 +02:00
|
|
|
Matches all targets of a \fItarget\fR configuration section.
|
|
|
|
.RE
|
|
|
|
.PP
|
|
|
|
[hostname:]<target-directory>/<snapshot-name>
|
|
|
|
.RS 4
|
|
|
|
Matches a single target of a \fItarget\fR section within a
|
|
|
|
\fIsubvolume\fR section with given <snapshot-name>.
|
2015-09-20 17:47:46 +02:00
|
|
|
.RE
|
|
|
|
.PP
|
|
|
|
<group-name>
|
|
|
|
.RS 4
|
|
|
|
Matches the \fIgroup\fR configuration option of a \fIvolume\fR,
|
|
|
|
\fIsubvolume\fR or \fItarget\fR section.
|
|
|
|
.RE
|
|
|
|
.PP
|
|
|
|
For convenience, [hostname:] can be specified as either "hostname:",
|
|
|
|
"{hostname}" or "ssh://hostname/".
|
2015-02-08 13:43:29 +01:00
|
|
|
.SH FILES
|
2015-09-03 18:02:19 +02:00
|
|
|
.PP
|
2015-02-08 13:43:29 +01:00
|
|
|
/etc/btrbk.conf
|
2015-09-03 18:02:19 +02:00
|
|
|
.br
|
2015-02-08 13:43:29 +01:00
|
|
|
/etc/btrbk/btrbk.conf
|
2015-09-03 18:02:19 +02:00
|
|
|
.RS 4
|
2015-02-08 13:43:29 +01:00
|
|
|
Default configuration file. The file format and configuration options
|
|
|
|
are described in
|
|
|
|
.BR btrbk.conf (5).
|
2015-09-03 18:02:19 +02:00
|
|
|
.RE
|
2015-02-08 13:43:29 +01:00
|
|
|
.PD
|
|
|
|
.SH EXIT STATUS
|
|
|
|
.sp
|
2015-05-25 17:13:36 +02:00
|
|
|
\fBbtrbk\fR returns a zero exit status if it succeeds. Non-zero is
|
2015-02-08 13:43:29 +01:00
|
|
|
returned in case of failure.
|
|
|
|
.SH AVAILABILITY
|
|
|
|
Please refer to the btrbk project page
|
2015-03-19 12:48:09 +01:00
|
|
|
\fBhttp://www.digint.ch/btrbk/\fR for further
|
2015-02-08 13:43:29 +01:00
|
|
|
details.
|
|
|
|
.SH SEE ALSO
|
|
|
|
.BR btrbk.conf (5),
|
|
|
|
.BR btrfs (1)
|
|
|
|
.PP
|
|
|
|
For more information about btrfs and incremental backups, see the web
|
|
|
|
site at https://btrfs.wiki.kernel.org/index.php/Incremental_Backup
|
|
|
|
.SH AUTHOR
|
|
|
|
Axel Burri <axel@tty0.ch>
|