X-Git-Url: http://git.rot13.org/?p=BackupPC.git;a=blobdiff_plain;f=lib%2FBackupPC%2FXfer%2FTar.pm;h=7750731a50d7b8a1912e68e7eb327554c65eb413;hp=b082bab62c14cb34f75d5057c66c401385767c95;hb=2a19fd178108b0898e79d2b8908236429ca4c6a3;hpb=99b9efe77451800084c477ed2139100f830cb7db diff --git a/lib/BackupPC/Xfer/Tar.pm b/lib/BackupPC/Xfer/Tar.pm index b082bab..7750731 100644 --- a/lib/BackupPC/Xfer/Tar.pm +++ b/lib/BackupPC/Xfer/Tar.pm @@ -29,7 +29,7 @@ # #======================================================================== # -# Version 2.1.2, released 5 Sep 2005. +# Version 2.1.3, released 21 Jan 2007. # # See http://backuppc.sourceforge.net. # @@ -198,7 +198,12 @@ sub readOutput my $mesg; if ( sysread($t->{pipeTar}, $mesg, 8192) <= 0 ) { vec($$FDreadRef, fileno($t->{pipeTar}), 1) = 0; - if ( !close($t->{pipeTar}) ) { + if ( !close($t->{pipeTar}) && $? != 256 ) { + # + # Tar 1.16 uses exit status 1 (256) when some files + # changed during archive creation. We allow this + # as a benign error and consider the archive ok + # $t->{tarOut} .= "Tar exited with error $? ($!) status\n"; $t->{xferOK} = 0 if ( !$t->{tarBadExitOk} ); } @@ -214,15 +219,20 @@ sub readOutput # alarm($conf->{ClientTimeout}) if ( !$t->{abort} ); $t->{lastOutputLine} = $_ if ( !/^$/ ); - if ( /^Total bytes written: / ) { + if ( /^Total bytes (written|read): / ) { $t->{XferLOG}->write(\"$_\n") if ( $t->{logLevel} >= 1 ); $t->{xferOK} = 1; } elsif ( /^\./ ) { $t->{XferLOG}->write(\"$_\n") if ( $t->{logLevel} >= 2 ); $t->{fileCnt}++; } else { - $t->{XferLOG}->write(\"$_\n") if ( $t->{logLevel} >= 0 ); - $t->{xferErrCnt}++; + # + # Ignore annoying log message on incremental for tar 1.15.x + # + if ( !/: file is unchanged; not dumped$/ ) { + $t->{XferLOG}->write(\"$_\n") if ( $t->{logLevel} >= 0 ); + $t->{xferErrCnt}++; + } # # If tar encounters a minor error, it will exit with a non-zero # status. We still consider that ok. Remember if tar prints