70 |
# |
# |
71 |
#======================================================================== |
#======================================================================== |
72 |
# |
# |
73 |
# Version 2.1.0, released 20 Jun 2004. |
# Version 2.1.2, released 5 Sep 2005. |
74 |
# |
# |
75 |
# See http://backuppc.sourceforge.net. |
# See http://backuppc.sourceforge.net. |
76 |
# |
# |
348 |
} |
} |
349 |
|
|
350 |
if ( !$opts{i} && !$opts{f} && $StatusHost{backoffTime} > time ) { |
if ( !$opts{i} && !$opts{f} && $StatusHost{backoffTime} > time ) { |
351 |
printf(LOG "%sskipping because of user requested delay (%.1f hours left)", |
printf(LOG "%sskipping because of user requested delay (%.1f hours left)\n", |
352 |
$bpc->timeStamp, ($StatusHost{backoffTime} - time) / 3600); |
$bpc->timeStamp, ($StatusHost{backoffTime} - time) / 3600); |
353 |
NothingToDo($needLink); |
NothingToDo($needLink); |
354 |
} |
} |
434 |
# |
# |
435 |
# Setup file extension for compression and open XferLOG output file |
# Setup file extension for compression and open XferLOG output file |
436 |
# |
# |
437 |
$Conf{CompressLevel} = 0 if ( !BackupPC::FileZIO->compOk ); |
if ( $Conf{CompressLevel} && !BackupPC::FileZIO->compOk ) { |
438 |
|
print(LOG $bpc->timeStamp, "dump failed: can't find Compress::Zlib\n"); |
439 |
|
print("dump failed: can't find Compress::Zlib\n"); |
440 |
|
exit(1); |
441 |
|
} |
442 |
my $fileExt = $Conf{CompressLevel} > 0 ? ".z" : ""; |
my $fileExt = $Conf{CompressLevel} > 0 ? ".z" : ""; |
443 |
my $XferLOG = BackupPC::FileZIO->open("$Dir/XferLOG$fileExt", 1, |
my $XferLOG = BackupPC::FileZIO->open("$Dir/XferLOG$fileExt", 1, |
444 |
$Conf{CompressLevel}); |
$Conf{CompressLevel}); |
1114 |
$fullKeepCnt = [$fullKeepCnt] if ( ref($fullKeepCnt) ne "ARRAY" ); |
$fullKeepCnt = [$fullKeepCnt] if ( ref($fullKeepCnt) ne "ARRAY" ); |
1115 |
my $fullAgeMax; |
my $fullAgeMax; |
1116 |
my $fullPeriod = int(0.5 + $Conf{FullPeriod}); |
my $fullPeriod = int(0.5 + $Conf{FullPeriod}); |
1117 |
|
$fullPeriod = 7 if ( $fullPeriod <= 0 ); |
1118 |
for ( my $i = 0 ; $i < @$fullKeepCnt ; $i++ ) { |
for ( my $i = 0 ; $i < @$fullKeepCnt ; $i++ ) { |
1119 |
$fullAgeMax += $fullKeepCnt->[$i] * $fullPeriod; |
$fullAgeMax += $fullKeepCnt->[$i] * $fullPeriod; |
1120 |
$fullPeriod *= 2; |
$fullPeriod *= 2; |
1201 |
# |
# |
1202 |
# Delete the full backup |
# Delete the full backup |
1203 |
# |
# |
1204 |
#printf("Deleting backup $i ($prevFull)\n"); |
#print("Deleting backup $i ($prevFull)\n"); |
1205 |
push(@delete, $i); |
unshift(@delete, $i); |
1206 |
} else { |
} else { |
1207 |
$fullCnt++; |
$fullCnt++; |
1208 |
while ( $fullKeepIdx < @$fullKeepCnt |
while ( $fullKeepIdx < @$fullKeepCnt |
1343 |
my($client, $Backups, $idx) = @_; |
my($client, $Backups, $idx) = @_; |
1344 |
my($Dir) = "$TopDir/pc/$client"; |
my($Dir) = "$TopDir/pc/$client"; |
1345 |
|
|
1346 |
|
if ( $Backups->[$idx]{num} eq "" ) { |
1347 |
|
print("BackupRemove: ignoring empty backup number for idx $idx\n"); |
1348 |
|
return; |
1349 |
|
} |
1350 |
|
|
1351 |
$bpc->RmTreeDefer("$TopDir/trash", |
$bpc->RmTreeDefer("$TopDir/trash", |
1352 |
"$Dir/$Backups->[$idx]{num}"); |
"$Dir/$Backups->[$idx]{num}"); |
1353 |
unlink("$Dir/SmbLOG.$Backups->[$idx]{num}") |
unlink("$Dir/SmbLOG.$Backups->[$idx]{num}") |