/[BackupPC]/trunk/bin/BackupPC_dump
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/bin/BackupPC_dump

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 315 by dpavlin, Wed Jun 22 19:12:42 2005 UTC revision 316 by dpavlin, Mon Jan 30 13:37:17 2006 UTC
# Line 70  Line 70 
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  #  #
# Line 348  if ( !$opts{i} && !$opts{f} && $Conf{Bla Line 348  if ( !$opts{i} && !$opts{f} && $Conf{Bla
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  }  }
# Line 434  $bpc->RmTreeDefer("$TopDir/trash", "$Dir Line 434  $bpc->RmTreeDefer("$TopDir/trash", "$Dir
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});
# Line 1110  sub BackupExpire Line 1114  sub BackupExpire
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;
# Line 1196  sub BackupFullExpire Line 1201  sub BackupFullExpire
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
# Line 1338  sub BackupRemove Line 1343  sub BackupRemove
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}")

Legend:
Removed from v.315  
changed lines
  Added in v.316

  ViewVC Help
Powered by ViewVC 1.1.26