#
#========================================================================
#
-# Version 1.6.0_CVS, released 10 Dec 2002.
+# Version 2.0.0_CVS, released 3 Feb 2003.
#
# See http://backuppc.sourceforge.net.
#
$RsyncLibOK = 0;
$RsyncLibErr = "File::RsyncP module doesn't exist";
} else {
- if ( $File::RsyncP::VERSION < 0.20 ) {
+ if ( $File::RsyncP::VERSION < 0.30 ) {
$RsyncLibOK = 0;
- $RsyncLibErr = "File::RsyncP module version too old: need 0.20";
+ $RsyncLibErr = "File::RsyncP module version too old: need 0.30";
} else {
$RsyncLibOK = 1;
}
#
# 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};
$remoteDir =~ s{//+}{/}g;
$argList = ['--server', @$rsyncArgs, '.', $remoteDir];
$fioArgs = {
- host => $t->{bkupSrcHost},
+ client => $t->{bkupSrcHost},
share => $t->{bkupSrcShare},
viewNum => $t->{bkupSrcNum},
fileList => $t->{fileList},
$argList = ['--server', '--sender', @$rsyncArgs,
'.', $t->{shareNameSlash}];
$fioArgs = {
- host => $t->{host},
+ client => $t->{client},
share => $t->{shareName},
viewNum => $t->{lastFullBkupNum},
};
#
# Merge variables into $rsyncClientCmd
#
- $rsyncClientCmd = $bpc->cmdVarSubstitute($rsyncClientCmd,
- {
- host => $t->{host},
- hostIP => $t->{hostIP},
- shareName => $t->{shareName},
- shareNameSlash => $t->{shareNameSlash},
- rsyncPath => $conf->{RsyncClientPath},
- sshPath => $conf->{SshPath},
- argList => $argList,
- });
+ my $args = {
+ host => $t->{host},
+ hostIP => $t->{hostIP},
+ client => $t->{client},
+ shareName => $t->{shareName},
+ shareNameSlash => $t->{shareNameSlash},
+ rsyncPath => $conf->{RsyncClientPath},
+ sshPath => $conf->{SshPath},
+ argList => $argList,
+ };
+ $rsyncClientCmd = $bpc->cmdVarSubstitute($rsyncClientCmd, $args);
#
# Create the Rsync object, and tell it to use our own File::RsyncP::FileIO
$t->{rs} = File::RsyncP->new({
logLevel => $conf->{RsyncLogLevel},
rsyncCmd => sub {
- $bpc->cmdExecOrEval($rsyncClientCmd);
+ $bpc->cmdExecOrEval($rsyncClientCmd, $args);
},
rsyncCmdType => "full",
rsyncArgs => $rsyncArgs,
+ timeout => $conf->{ClientTimeout},
logHandler => sub {
my($str) = @_;
$str .= "\n";
conf => $t->{conf},
backups => $t->{backups},
logLevel => $conf->{RsyncLogLevel},
- timeout => $conf->{ClientTimeout},
logHandler => sub {
my($str) = @_;
$str .= "\n";
#
# Run rsync command
#
- $t->{XferLOG}->write(\"Running: @{$t->{rsyncClientCmd}}\n");
+ my $str = "Running: "
+ . $t->{bpc}->execCmd2ShellCmd(@{$t->{rsyncClientCmd}})
+ . "\n";
+ $t->{XferLOG}->write(\$str);
$rs->remoteStart($remoteSend, $remoteDir);
} else {
#
if ( defined(my $err = $rs->serverConnect($t->{hostIP},
$conf->{RsyncdClientPort})) ) {
$t->{hostError} = $err;
+ my $str = "Error connecting to rsync daemon at $t->{hostIP}"
+ . ":$conf->{RsyncdClientPort}: $err\n";
+ $t->{XferLOG}->write(\$str);
return;
}
#
$conf->{RsyncdUserName},
$conf->{RsyncdPasswd},
$conf->{RsyncdAuthRequired})) ) {
+ my $str = "Error connecting to module $module at $t->{hostIP}"
+ . ":$conf->{RsyncdClientPort}: $err\n";
+ $t->{XferLOG}->write(\$str);
$t->{hostError} = $err;
return;
}