X-Git-Url: http://git.rot13.org/?p=BackupPC.git;a=blobdiff_plain;f=lib%2FBackupPC%2FXfer%2FTar.pm;h=46378285bfa684c3263cbe43f1a535ee8a53431c;hp=60326e194539cc06fed94dd2b58f40630877b8be;hb=0697368bbcef14908cd4684cf07744dc840464de;hpb=3dc33e5f39430031766adf3c5bb2ffc649ee9100 diff --git a/lib/BackupPC/Xfer/Tar.pm b/lib/BackupPC/Xfer/Tar.pm index 60326e1..4637828 100644 --- a/lib/BackupPC/Xfer/Tar.pm +++ b/lib/BackupPC/Xfer/Tar.pm @@ -29,7 +29,7 @@ # #======================================================================== # -# Version 1.6.0_CVS, released 10 Dec 2002. +# Version 2.0.0_CVS, released 18 Jan 2003. # # See http://backuppc.sourceforge.net. # @@ -82,11 +82,7 @@ sub start local(*TAR); if ( $t->{type} eq "restore" ) { - if ( ref($conf->{TarClientRestoreCmd}) eq "ARRAY" ) { - $tarClientCmd = $conf->{TarClientRestoreCmd}; - } else { - $tarClientCmd = [split(/ +/, $conf->{TarClientRestoreCmd})]; - } + $tarClientCmd = $conf->{TarClientRestoreCmd}; $logMsg = "restore started below directory $t->{shareName}"; # # restores are considered to work unless we see they fail @@ -149,15 +145,17 @@ sub start # # Merge variables into @tarClientCmd # - $tarClientCmd = $bpc->cmdVarSubstitute($tarClientCmd, { + my $args = { host => $t->{host}, hostIP => $t->{hostIP}, + client => $t->{client}, incrDate => $incrDate, shareName => $t->{shareName}, fileList => \@fileList, tarPath => $conf->{TarClientPath}, sshPath => $conf->{SshPath}, - }); + }; + $tarClientCmd = $bpc->cmdVarSubstitute($tarClientCmd, $args); if ( !defined($t->{xferPid} = open(TAR, "-|")) ) { $t->{_errStr} = "Can't fork to run tar"; return; @@ -191,11 +189,12 @@ sub start # # Run the tar command # - $bpc->cmdExecOrEval($tarClientCmd); + $bpc->cmdExecOrEval($tarClientCmd, $args); # should not be reached, but just in case... $t->{_errStr} = "Can't exec @$tarClientCmd"; return; } + my $str = "Running: " . $bpc->execCmd2ShellCmd(@$tarClientCmd) . "\n"; $t->{XferLOG}->write(\"Running: @$tarClientCmd\n"); alarm($conf->{ClientTimeout}); $t->{_errStr} = undef;