diff --git a/btrbk b/btrbk index e53405c..94d7c06 100755 --- a/btrbk +++ b/btrbk @@ -147,12 +147,12 @@ sub HELP_MESSAGE print STDERR " --progress show progress bar on send-receive operation\n"; print STDERR "\n"; print STDERR "commands:\n"; - print STDERR " run [subvol|group...] perform backup operations as defined in the config file\n"; - print STDERR " dryrun [subvol|group...] don't run btrfs commands; show what would be executed\n"; - print STDERR " tree [subvol|group...] shows backup tree\n"; - print STDERR " info [subvol|group...] print useful filesystem information\n"; - print STDERR " origin print origin information for subvolume\n"; - print STDERR " diff shows new files since subvolume for subvolume \n"; + print STDERR " run [filter...] perform backup operations as defined in the config file\n"; + print STDERR " dryrun [filter...] don't run btrfs commands; show what would be executed\n"; + print STDERR " tree [filter...] shows backup tree\n"; + print STDERR " info [filter...] print useful filesystem information\n"; + print STDERR " origin print origin information for subvolume\n"; + print STDERR " diff shows new files since subvolume for subvolume \n"; print STDERR "\n"; print STDERR "For additional information, see $PROJECT_HOME\n"; } diff --git a/doc/btrbk.1 b/doc/btrbk.1 index fbfe430..2a98027 100644 --- a/doc/btrbk.1 +++ b/doc/btrbk.1 @@ -81,13 +81,12 @@ Show progress bar on send-receive operation. .SH COMMANDS .PP .B run -[subvolume...] +[filter...] .RS 4 Perform backup operations as specified in the configuration file. If -the optional [subvolume...] arguments are present, backups are only -performed for the specified subvolumes (which must match a -volume/subvolume declaration in the configuration file), and the -p -(preserve backups) option is implied. +the optional [filter...] arguments are present, backups are only +performed for the subvolumes/targets matching a \fIFILTER STATEMENT\fR +(see below). .PP First, btrbk reads information from the source and target btrfs filesystems in order to perform sanity checks and identify @@ -113,7 +112,7 @@ of the retention policy. .RE .PP .B dryrun -[subvolume...] +[filter...] .RS 4 Don't run btrfs commands, just show the snapshots and backup subvolumes that would be created/deleted by the \fBrun\fR command. Use @@ -122,17 +121,19 @@ would be executed. .RE .PP .B info -[subvolume...] +[filter...] .RS 4 Print filesystem usage information for all source/target -volumes. Optionally filtered by [subvolume...] arguments. +volumes. Optionally filtered by [filter...] arguments (see \fIFILTER +STATEMENTS\fR below). .RE .PP .B tree -[subvolume...] +[filter...] .RS 4 Print the snapshots and their corresponding backup subvolumes as a -tree. Optionally filtered by [subvolume...] arguments. +tree. Optionally filtered by [filter...] arguments (see \fIFILTER +STATEMENTS\fR below). .RE .PP .B origin @@ -147,6 +148,33 @@ parent-child relationship as well as the received-from information. .RS 4 Print new files since subvolume for subvolume . .RE +.SH FILTER STATEMENTS +Filter arguments are accepted in form: +.PP +[hostname:] +.RS 4 +Matches all subvolumes and targets of a \fIvolume\fR configuration section. +.RE +.PP +[hostname:]/ +.RS 4 +Matches the specified subvolume and all targets of a \fIsubvolume\fR +configuration section. +.RE +.PP +[hostname:] +.RS 4 +Matches a single target of a \fItarget\fR configuration section. +.RE +.PP + +.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/". .SH FILES .PP /etc/btrbk.conf diff --git a/doc/btrbk.conf.5 b/doc/btrbk.conf.5 index 2061b2a..aa5b5df 100644 --- a/doc/btrbk.conf.5 +++ b/doc/btrbk.conf.5 @@ -140,6 +140,13 @@ Defines on what day a backup/snapshot is considered as a weekly backup. Defaults to \[lq]sunday\[rq]. .RE .PP +\fBgroup\fR [,]... +.RS 4 +Add the current section (volume, subvolume or target) to a +user-defined group, which can be used as filter for several btrbk +commands. +.RE +.PP \fBssh_identity\fR .RS 4 Absolute path to a ssh identity file (private key). Note that if the