X-Git-Url: http://git.rot13.org/?p=BackupPC.git;a=blobdiff_plain;f=bin%2FBackupPC_dump;h=62173e79f829eada33afba75c2d36cffa0be0858;hp=d2ed36183fe15bf3d5cf8cff988560a72f537b9a;hb=e951f787a66c5bd9e9955c3f657a5b44289c0fe1;hpb=79e0593c501fd58046feeca20c315cc4ac283435 diff --git a/bin/BackupPC_dump b/bin/BackupPC_dump index d2ed361..62173e7 100755 --- a/bin/BackupPC_dump +++ b/bin/BackupPC_dump @@ -70,7 +70,7 @@ # #======================================================================== # -# Version 2.1.0beta2, released 23 May 2004. +# Version 2.1.0, released 20 Jun 2004. # # See http://backuppc.sourceforge.net. # @@ -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 $fullAgeMax; + my $fullPeriod = int(0.5 + $Conf{FullPeriod}); + for ( my $i = 0 ; $i < @$fullKeepCnt ; $i++ ) { + $fullAgeMax += $fullKeepCnt->[$i] * $fullPeriod; + $fullPeriod *= 2; + } + $fullAgeMax += $fullPeriod; # add some buffer + if ( $cntFull > $Conf{FullKeepCntMin} && $oldestFull > $Conf{FullAgeMax} + && $oldestFull > $fullAgeMax + && $Conf{FullKeepCntMin} > 0 + && $Conf{FullAgeMax} > 0 && (@Backups <= $firstFull + 1 || !$Backups[$firstFull + 1]{noFill}) ) { # @@ -1367,9 +1384,9 @@ sub pidHandler # sub UserCommandRun { - my($type) = @_; + my($cmdType) = @_; - return if ( !defined($Conf{$type}) ); + return if ( !defined($Conf{$cmdType}) ); my $vars = { xfer => $xfer, client => $client, @@ -1387,9 +1404,10 @@ sub UserCommandRun xferOK => $stat{xferOK} || 0, hostError => $stat{hostError}, type => $type, + cmdType => $cmdType, }; - my $cmd = $bpc->cmdVarSubstitute($Conf{$type}, $vars); - $XferLOG->write(\"Executing $type: @$cmd\n"); + my $cmd = $bpc->cmdVarSubstitute($Conf{$cmdType}, $vars); + $XferLOG->write(\"Executing $cmdType: @$cmd\n"); # # Run the user's command, dumping the stdout/stderr into the # Xfer log file. Also supply the optional $vars and %Conf in