X-Git-Url: http://git.rot13.org/?p=BackupPC.git;a=blobdiff_plain;f=bin%2FBackupPC_dump;h=592fb599d0d56b4b4f7d1415b435c2193b0cc99f;hp=c37e239afbaf28f29be66b4c3b0cd23b38e1d928;hb=99b9efe77451800084c477ed2139100f830cb7db;hpb=3a173f3feb7dad79150eabf07bc8f304e13cdfe7 diff --git a/bin/BackupPC_dump b/bin/BackupPC_dump index c37e239..592fb59 100755 --- a/bin/BackupPC_dump +++ b/bin/BackupPC_dump @@ -70,7 +70,7 @@ # #======================================================================== # -# Version 2.1.0, released 20 Jun 2004. +# Version 2.1.2, released 5 Sep 2005. # # See http://backuppc.sourceforge.net. # @@ -78,7 +78,7 @@ use strict; no utf8; -use lib "/usr/local/BackupPC/lib"; +use lib "/usr/local/BackupPC2.1.0/lib"; use BackupPC::Lib; use BackupPC::FileZIO; use BackupPC::Xfer::Smb; @@ -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}); @@ -1110,6 +1114,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; @@ -1196,8 +1201,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 @@ -1338,6 +1343,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}")