prune: introduce keep-all option

useful to have an alternative to the old maxfiles = 0. There has to
be a way for vzdump to distinguish between:
1. use the /etc/vzdump.conf default (when no options are configured for the storage)
2. use no limit (when keep-all=1)

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
This commit is contained in:
Fabian Ebner
2020-11-23 13:33:08 +01:00
committed by Thomas Lamprecht
parent 5045e0b77a
commit 1b87f01388
3 changed files with 34 additions and 6 deletions

View File

@ -1623,7 +1623,10 @@ my $prune_mark = sub {
sub prune_mark_backup_group {
my ($backup_group, $keep) = @_;
if (!scalar(grep {$_ > 0} values %{$keep})) {
my $keep_all = delete $keep->{'keep-all'};
if ($keep_all || !scalar(grep {$_ > 0} values %{$keep})) {
$keep = { 'keep-all' => 1 } if $keep_all;
foreach my $prune_entry (@{$backup_group}) {
$prune_entry->{mark} = 'keep';
}