X-Git-Url: http://git.rot13.org/?p=BackupPC.git;a=blobdiff_plain;f=lib%2FBackupPC%2FXfer%2FTar.pm;h=79d05a88ce6330fd4d344b388e4dd75195576a8b;hp=004808d043188e04690e3a0e72164839376a82ab;hb=f41207123efc0156687d3f7994cd245a70d7de62;hpb=df717077755b9331fa245f72933ef03add7a3710 diff --git a/lib/BackupPC/Xfer/Tar.pm b/lib/BackupPC/Xfer/Tar.pm index 004808d..79d05a8 100644 --- a/lib/BackupPC/Xfer/Tar.pm +++ b/lib/BackupPC/Xfer/Tar.pm @@ -11,7 +11,7 @@ # Craig Barratt # # COPYRIGHT -# Copyright (C) 2001-2003 Craig Barratt +# Copyright (C) 2001-2007 Craig Barratt # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -29,7 +29,7 @@ # #======================================================================== # -# Version 3.0.0beta1, released 30 Jul 2006. +# Version 3.1.0beta0, released 3 Sep 2007. # # See http://backuppc.sourceforge.net. # @@ -101,8 +101,7 @@ sub start if ( defined($conf->{BackupFilesExclude}{$t->{shareName}}) ) { foreach my $file ( @{$conf->{BackupFilesExclude}{$t->{shareName}}} ) { - $file = $2 if ( $file =~ m{^(\./+|/+)(.*)}s ); - $file = "./$file"; + $file = "./$2" if ( $file =~ m{^(\./+|/+)(.*)}s ); $file = encode($conf->{ClientCharset}, $file) if ( $conf->{ClientCharset} ne "" ); push(@fileList, "--exclude=$file"); @@ -210,7 +209,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} ); } @@ -229,7 +233,7 @@ 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 ( /^\./ ) { @@ -239,7 +243,7 @@ sub readOutput # # Ignore annoying log message on incremental for tar 1.15.x # - if ( !/: file is unchanged; not dumped$/ ) { + if ( !/: file is unchanged; not dumped$/ && !/: socket ignored$/ ) { $t->{XferLOG}->write(\"$_\n") if ( $t->{logLevel} >= 0 ); $t->{xferErrCnt}++; }