X-Git-Url: http://git.rot13.org/?p=BackupPC.git;a=blobdiff_plain;f=bin%2FBackupPC_dump;h=8151cbd0df6dd4f178d7cc44a9962dbb5d90ad2a;hp=ccf71d606cfa9b02224cd76c6919bbe79b82eaf5;hb=17dcbbebb871212f90b81bb97f8d1feb528bdc43;hpb=d13d57e035dac9362ca393991b978530402969b7 diff --git a/bin/BackupPC_dump b/bin/BackupPC_dump index ccf71d6..8151cbd 100755 --- a/bin/BackupPC_dump +++ b/bin/BackupPC_dump @@ -434,7 +434,11 @@ $bpc->RmTreeDefer("$TopDir/trash", "$Dir/new") if ( -d "$Dir/new" ); # # Setup file extension for compression and open XferLOG output file # -$Conf{CompressLevel} = 0 if ( !BackupPC::FileZIO->compOk ); +if ( $Conf{CompressLevel} && !BackupPC::FileZIO->compOk ) { + print(LOG $bpc->timeStamp, "dump failed: can't find Compress::Zlib\n"); + print("dump failed: can't find Compress::Zlib\n"); + exit(1); +} my $fileExt = $Conf{CompressLevel} > 0 ? ".z" : ""; my $XferLOG = BackupPC::FileZIO->open("$Dir/XferLOG$fileExt", 1, $Conf{CompressLevel}); @@ -1117,6 +1121,7 @@ sub BackupExpire $fullKeepCnt = [$fullKeepCnt] if ( ref($fullKeepCnt) ne "ARRAY" ); my $fullAgeMax; my $fullPeriod = int(0.5 + $Conf{FullPeriod}); + $fullPeriod = 7 if ( $fullPeriod <= 0 ); for ( my $i = 0 ; $i < @$fullKeepCnt ; $i++ ) { $fullAgeMax += $fullKeepCnt->[$i] * $fullPeriod; $fullPeriod *= 2; @@ -1203,8 +1208,8 @@ sub BackupFullExpire # # Delete the full backup # - #printf("Deleting backup $i ($prevFull)\n"); - push(@delete, $i); + #print("Deleting backup $i ($prevFull)\n"); + unshift(@delete, $i); } else { $fullCnt++; while ( $fullKeepIdx < @$fullKeepCnt @@ -1345,6 +1350,11 @@ sub BackupRemove my($client, $Backups, $idx) = @_; my($Dir) = "$TopDir/pc/$client"; + if ( $Backups->[$idx]{num} eq "" ) { + print("BackupRemove: ignoring empty backup number for idx $idx\n"); + return; + } + $bpc->RmTreeDefer("$TopDir/trash", "$Dir/$Backups->[$idx]{num}"); unlink("$Dir/SmbLOG.$Backups->[$idx]{num}")