X-Git-Url: http://git.rot13.org/?p=BackupPC.git;a=blobdiff_plain;f=bin%2FBackupPC_dump;h=b974172c044a615bd8057827bcf440b901c08e12;hp=d2ed36183fe15bf3d5cf8cff988560a72f537b9a;hb=07d524e222fd3eeffccd2355f4a20ca5eba82f1b;hpb=17cae8e0d49abdddee277506fe5e58b88c646b5d diff --git a/bin/BackupPC_dump b/bin/BackupPC_dump index d2ed361..b974172 100755 --- a/bin/BackupPC_dump +++ b/bin/BackupPC_dump @@ -1102,8 +1102,25 @@ sub BackupExpire # Delete any old full backups, according to $Conf{FullKeepCntMin} # and $Conf{FullAgeMax}. # + # First make sure that $Conf{FullAgeMax} is at least bigger + # than $Conf{FullPeriod} * $Conf{FullKeepCnt}, including + # the exponential array case. + # + my $fullKeepCnt = $Conf{FullKeepCnt}; + $fullKeepCnt = [$fullKeepCnt] if ( ref($fullKeepCnt) ne "ARRAY" ); + my $oldestFull; + my $fullPeriod = int(0.5 + $Conf{FullPeriod}); + for ( my $i = 0 ; $i < @$fullKeepCnt ; $i++ ) { + $oldestFull += $fullKeepCnt->[$i] * $fullPeriod; + $fullPeriod *= 2; + } + $oldestFull += $fullPeriod; # add some buffer + if ( $cntFull > $Conf{FullKeepCntMin} && $oldestFull > $Conf{FullAgeMax} + && $oldestFull > $oldestFull + && $Conf{FullKeepCntMin} > 0 + && $Conf{FullAgeMax} > 0 && (@Backups <= $firstFull + 1 || !$Backups[$firstFull + 1]{noFill}) ) { #