]> git.proxmox.com Git - pve-storage.git/blobdiff - PVE/Storage.pm
prune mark: keep all if all prune options are zero/missing
[pve-storage.git] / PVE / Storage.pm
index 932f0f186e5d9e1e39fadae4708e47056e75c7d9..a2f400cddcd8264fe96fa2927f297271018c055c 100755 (executable)
@@ -1622,6 +1622,13 @@ my $prune_mark = sub {
 sub prune_mark_backup_group {
     my ($backup_group, $keep) = @_;
 
+    if (!scalar(grep {$_ > 0} values %{$keep})) {
+       foreach my $prune_entry (@{$backup_group}) {
+           $prune_entry->{mark} = 'keep';
+       }
+       return;
+    }
+
     my $prune_list = [ sort { $b->{ctime} <=> $a->{ctime} } @{$backup_group} ];
 
     $prune_mark->($prune_list, $keep->{'keep-last'}, sub {