From d367eab2497fd9d7510c8b831651c1f0f0c41c06 Mon Sep 17 00:00:00 2001 From: cbarratt Date: Fri, 7 Feb 2003 05:51:22 +0000 Subject: [PATCH] Try again; cvs got an error: - Fixed rsync is case of shareName = '/' - Repaired host name regex to correctly allow '-' in host name - Added sshPath to Pre/Post command vars - Ensured child exited after failed exec for Pre/Post commands - Added space before $I_option in Smb. - Made $I_option a listref, rather than string, for Smb --- lib/BackupPC/Lib.pm | 4 +++- lib/BackupPC/Xfer/Rsync.pm | 2 +- lib/BackupPC/Xfer/Smb.pm | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/BackupPC/Lib.pm b/lib/BackupPC/Lib.pm index 8cc1e83..e061eee 100644 --- a/lib/BackupPC/Lib.pm +++ b/lib/BackupPC/Lib.pm @@ -314,7 +314,7 @@ sub HostInfoRead s/[\n\r]+//; s/#.*//; s/\s+$//; - next if ( /^\s*$/ || !/^([\w\.-\\]+\s+.*)/ ); + next if ( /^\s*$/ || !/^([\w\.\\-]+\s+.*)/ ); # # Split on white space, except if preceded by \ # using zero-width negative look-behind assertion @@ -985,6 +985,8 @@ sub cmdSystemOrEval close(STDERR); open(STDERR, ">&STDOUT"); exec(@$cmd); + print("Exec of @$cmd failed\n"); + exit(1); } # # The parent gathers the output from the child diff --git a/lib/BackupPC/Xfer/Rsync.pm b/lib/BackupPC/Xfer/Rsync.pm index 11103ca..cf20d64 100644 --- a/lib/BackupPC/Xfer/Rsync.pm +++ b/lib/BackupPC/Xfer/Rsync.pm @@ -119,7 +119,7 @@ sub start # # We add a slash to the share name we pass to rsync # - ($t->{shareNameSlash} = "$t->{shareName}/") =~ s{//+$}{}; + ($t->{shareNameSlash} = "$t->{shareName}/") =~ s{//+$}{/}; if ( $t->{type} eq "restore" ) { $rsyncClientCmd = $conf->{RsyncClientRestoreCmd}; diff --git a/lib/BackupPC/Xfer/Smb.pm b/lib/BackupPC/Xfer/Smb.pm index bfd367a..d3b688b 100644 --- a/lib/BackupPC/Xfer/Smb.pm +++ b/lib/BackupPC/Xfer/Smb.pm @@ -78,7 +78,7 @@ sub start my($t) = @_; my $bpc = $t->{bpc}; my $conf = $t->{conf}; - my $I_option = $t->{hostIP} eq $t->{host} ? "" : " -I $t->{hostIP}"; + my $I_option = $t->{hostIP} eq $t->{host} ? [] : ['-I', $t->{hostIP}]; my(@fileList, $X_option, $smbClientCmd, $logMsg); my($timeStampFile); local(*SMB); -- 2.20.1