btrbk: add "-n, --dry-run" option

pull/63/head
Axel Burri 2016-01-14 15:53:52 +01:00
parent 3624a8fba0
commit 9718ad1460
3 changed files with 16 additions and 5 deletions

View File

@ -4,6 +4,7 @@ btrbk-current
* Bugfix: fix sprintf used by config option "timestamp_format long"
when using perl-5.22.0 (close: #57).
* Added "clean" command (close: #61).
* Added "-n, --dry-run" option.
btrbk-0.21.0

2
btrbk
View File

@ -205,6 +205,7 @@ sub HELP_MESSAGE
print STDERR " -h, --help display this help message\n";
print STDERR " --version display version information\n";
print STDERR " -c, --config=FILE specify configuration file\n";
print STDERR " -n, --dry-run perform a trial run with no changes made\n";
print STDERR " -p, --preserve preserve all backups (do not delete any old targets)\n";
print STDERR " -r, --resume-only resume only (do not create new snapshots, only resume\n";
print STDERR " missing backups)\n";
@ -2137,6 +2138,7 @@ MAIN:
'help|h' => sub { VERSION_MESSAGE(); HELP_MESSAGE(0); exit 0; },
'version' => sub { VERSION_MESSAGE(); exit 0; },
'config|c=s' => \$config_cmdline,
'dry-run|n' => \$dryrun,
'preserve|p' => \$preserve_backups,
'resume-only|r' => \$resume_only,
'quiet|q' => \$quiet,

View File

@ -8,7 +8,7 @@ btrbk \- backup tool for btrfs volumes
.SH SYNOPSIS
.nf
\fBbtrbk\fR [\-h|\-\-help] [\-\-version] [\-c|\-\-config <file>]
[\-p|\-\-preserve] [\-r|\-\-resume\-only]
[\-n|\-\-dry\-run] [\-p|\-\-preserve] [\-r|\-\-resume\-only]
[\-v|\-\-verbose] [\-q|\-\-quiet] [\-l|\-\-loglevel <level>]
[\-t|\-\-table] [\-\-format <output\-format>]
[\-\-progress]
@ -46,6 +46,14 @@ Prints the synopsis and a list of the commands.
Prints the btrbk version.
.RE
.PP
\-n, \-\-dry\-run
.RS 4
Don't run anything that would alter the filesystem, just show the
snapshots and backup subvolumes that would be created/deleted by the
\fBrun\fR and \fBclean\fR commands. Use in conjunction with \fI\-l
debug\fR to see the btrfs commands that would be executed.
.RE
.PP
\-c, \-\-config <file>
.RS 4
Read the configuration from <file>.
@ -138,10 +146,10 @@ different output formats.
.B dryrun
[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
in conjunction with \fI\-l debug\fR to see the btrfs commands that
would be executed.
Don't run any btrfs commands that would alter the filesystem, just
show the snapshots and backup 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.
.RE
.PP
.B list