X-Git-Url: http://git.rot13.org/?p=BackupPC.git;a=blobdiff_plain;f=bin%2FBackupPC_link;h=e4a7b2237d9f5ee1739891cdf14bb2802feb022d;hp=8c75cde186e1791229d4964246b5cea1553db18a;hb=5b3e6091d542c2e7445d5dd511cdf6e20aec8b8d;hpb=5c6a6cc4f333ce44a9df62ab828b0b9341579f7c diff --git a/bin/BackupPC_link b/bin/BackupPC_link index 8c75cde..e4a7b22 100755 --- a/bin/BackupPC_link +++ b/bin/BackupPC_link @@ -39,7 +39,7 @@ # #======================================================================== # -# Version 2.1.0beta1, released 9 Apr 2004. +# Version 3.0.0alpha, released 23 Jan 2006. # # See http://backuppc.sourceforge.net. # @@ -51,6 +51,7 @@ use lib "/usr/local/BackupPC/lib"; use BackupPC::Lib; use BackupPC::Attrib; use BackupPC::PoolWrite; +use BackupPC::Storage; use File::Find; use File::Path; @@ -156,6 +157,16 @@ while ( 1 ) { $Backups[$num]{sizeNewComp} += $sizeNewComp; $Backups[$num]{noFill} = $noFill; $Backups[$num]{fillFromNum} = $fillFromNum; + # + # Save just this backup's info in case the main backups file + # gets corrupted + # + BackupPC::Storage->backupInfoWrite($Dir, + $Backups[$num]{num}, + $Backups[$num], 1); + # + # Save the main backups file + # $bpc->BackupInfoWrite($host, @Backups); } @@ -211,7 +222,21 @@ sub FillIncr # # Exists in the older filled backup, and not in the new, so link it # - link($name, $newName); + my($exists, $digest, $origSize, $outSize, $errs) + = BackupPC::PoolWrite::LinkOrCopy( + $bpc, + $name, $Compress, + $newName, $Compress); + if ( $exists ) { + $nFilesExist++; + $sizeExist += $origSize; + $sizeExistComp += $outSize; + } elsif ( $outSize > 0 ) { + $nFilesNew++; + $sizeNew += $origSize; + $sizeNewComp += -s $outSize; + LinkNewFile($digest, $origSize, $newName); + } } }