btrbk: add "prune" command

pull/204/head
Axel Burri 2017-09-28 13:18:40 +02:00
parent 2809dc54c5
commit 5bdc3e527b
3 changed files with 20 additions and 0 deletions

View File

@ -6,6 +6,7 @@ btrbk-current
* Add "resume" command, replacement for "-r, --resume-only" command
line option (which is now deprecated).
* Add "snapshot" command (close #150).
* Add "prune" command.
* Add "--preserve-snapshots" and "--preserve-backups" options.
* Change raw backup format (sidecar file instead of uuid in file).
* Honor target_preserve for raw targets (delete raw targets).

8
btrbk
View File

@ -315,6 +315,7 @@ sub HELP_MESSAGE
print STDERR " dryrun don't run btrfs commands; show what would be executed\n";
print STDERR " snapshot run snapshot operations only\n";
print STDERR " resume run backup operations, and delete snapshots\n";
print STDERR " prune only delete snapshots and backups\n";
print STDERR " stats print snapshot/backup statistics\n";
print STDERR " list <subcommand> available subcommands are:\n";
print STDERR " backups all backups and corresponding snapshots\n";
@ -4226,6 +4227,13 @@ MAIN:
$args_allow_group = 1;
@filter_args = @ARGV;
}
elsif($command eq "prune") {
$action_run = 1;
$skip_snapshots = 1;
$skip_backups = 1;
$args_allow_group = 1;
@filter_args = @ARGV;
}
elsif ($command eq "clean") {
$action_clean = 1;
@filter_args = @ARGV;

View File

@ -223,6 +223,17 @@ retention policy. Use in conjunction with \-p, \-\-preserve,
backup and/or snapshot deletion (steps 3, 4).
.RE
.PP
.B prune
[filter...]
.RS 4
Prune snapshots and backups: skips snapshot and backup creation (steps
1, 2), only deletes snapshots and backups in order to satisfy their
configured retention policy. Useful for cleaning the disk after
changing the retention policy. Use in conjunction with
\-\-preserve\-backups, \-\-preserve\-snapshots if you want to skip
backup or snapshot deletion (steps 3, 4).
.RE
.PP
.B archive
<source> <target>
.I *experimental*