X-Git-Url: http://git.rot13.org/?p=BackupPC.git;a=blobdiff_plain;f=lib%2FBackupPC%2FXfer%2FSmb.pm;h=b362953c60e11473653e82ed82ce8c17d03d5587;hp=7cee1efc47201b702e748abfb61880eab4b7a21f;hb=8f5625f9cdf47f8e04be654c4954838b2df3e26d;hpb=2c14784ad71874ec850d189060fe63d6eb9eba95;ds=sidebyside diff --git a/lib/BackupPC/Xfer/Smb.pm b/lib/BackupPC/Xfer/Smb.pm index 7cee1ef..b362953 100644 --- a/lib/BackupPC/Xfer/Smb.pm +++ b/lib/BackupPC/Xfer/Smb.pm @@ -29,7 +29,7 @@ # #======================================================================== # -# Version 2.1.0_CVS, released 8 Feb 2004. +# Version 2.1.0beta0, released 20 Mar 2004. # # See http://backuppc.sourceforge.net. # @@ -231,12 +231,14 @@ sub readOutput # ignore the log file time stamps from smbclient introduced # in version 3.0.0 - don't even write them to the log file. # - next if ( m{^\[\d+/\d+/\d+ +\d+:\d+:\d+.*\] +(client/cli|lib/util_unistr).*\(\d+\)} ); - $t->{XferLOG}->write(\"$_\n"); + if ( m{^\[\d+/\d+/\d+ +\d+:\d+:\d+.*\] +(client/cli|lib/util_unistr).*\(\d+\)} ) { + $t->{XferLOG}->write(\"$_\n") if ( $t->{logLevel} >= 5 ); + next; + } # # refresh our inactivity alarm # - alarm($conf->{ClientTimeout}); + alarm($conf->{ClientTimeout}) if ( !$t->{abort} ); $t->{lastOutputLine} = $_ if ( !/^$/ ); # # This section is highly dependent on the version of smbclient. @@ -250,15 +252,20 @@ sub readOutput $fileName =~ s/^\/*//; $t->{byteCnt} += $sambaFileSize; $t->{fileCnt}++; + $t->{XferLOG}->write(\"$_\n") if ( $t->{logLevel} >= 2 ); } elsif ( /restore tar file (.*) of size (\d+) bytes/ ) { $t->{byteCnt} += $2; $t->{fileCnt}++; + $t->{XferLOG}->write(\"$_\n") if ( $t->{logLevel} >= 1 ); } elsif ( /^\s*tar: dumped \d+ files/ ) { $t->{xferOK} = 1; + $t->{XferLOG}->write(\"$_\n") if ( $t->{logLevel} >= 0 ); } elsif ( /^\s*tar: restored \d+ files/ ) { $t->{xferOK} = 1; + $t->{XferLOG}->write(\"$_\n") if ( $t->{logLevel} >= 0 ); } elsif ( /^\s*read_socket_with_timeout: timeout read. /i ) { $t->{hostAbort} = 1; + $t->{XferLOG}->write(\"$_\n") if ( $t->{logLevel} >= 0 ); } elsif ( /^code 0 listing / || /^\s*code 0 opening / || /^\s*abandoning restore/i @@ -272,6 +279,7 @@ sub readOutput $t->{XferLOG}->write(\"This backup will fail because: $_\n"); $t->{hostError} = $_; } + $t->{XferLOG}->write(\"$_\n") if ( $t->{logLevel} >= 0 ); } elsif ( /^\s*NT_STATUS_ACCESS_DENIED listing (.*)/ || /^\s*ERRDOS - ERRnoaccess \(Access denied\.\) listing (.*)/ ) { my $badDir = $1; @@ -283,6 +291,9 @@ sub readOutput $t->{XferLOG}->write(\"This backup will fail because: $_\n"); $t->{hostError} ||= $_; } + $t->{XferLOG}->write(\"$_\n") if ( $t->{logLevel} >= 0 ); + } elsif ( /^\s*directory \\/i ) { + $t->{XferLOG}->write(\"$_\n") if ( $t->{logLevel} >= 2 ); } elsif ( /smb: \\>/ || /^\s*added interface/i || /^\s*tarmode is now/i @@ -290,13 +301,13 @@ sub readOutput || /^\s*Domain=/i || /^\([\d\.]* kb\/s\) \(average [\d\.]* kb\/s\)$/i || /^\s*Getting files newer than/i - || /^\s*directory \\/i || /^\s*restore directory \\/i || /^\s*Output is \/dev\/null/i || /^\s*Timezone is/i || /^\s*creating lame (up|low)case table/i ) { # ignore these messages + $t->{XferLOG}->write(\"$_\n") if ( $t->{logLevel} >= 1 ); } else { $t->{xferErrCnt}++; $t->{xferBadShareCnt}++ if ( /^ERRDOS - ERRbadshare/ ); @@ -329,11 +340,20 @@ sub readOutput file => $badFile }); } + $t->{XferLOG}->write(\"$_\n") if ( $t->{logLevel} >= 1 ); } } return 1; } +sub abort +{ + my($t, $reason) = @_; + + $t->{abort} = 1; + $t->{abortReason} = $reason; +} + sub setSelectMask { my($t, $FDreadRef) = @_;