Subject: | destDirectory not used |
Date: | Mon, 17 Sep 2012 16:49:57 +1000 |
To: | bug-File-RsyncP [...] rt.cpan.org |
From: | 더그 <silvertray42 [...] nate.com> |
When sending files from client to server the destDirectory parameter
to remoteStart is not used.
According to the doco
# Send files to remote destDirectory from local srcDirectory
# by running rsyncCmd with rsyncArgs.
#
$rs->remoteStart(0, destDirectory);
$rs->go(srcDirectory);
$rs->serverClose;
So my script is thus:
my $rs = File::RsyncP->new({
logLevel => 1,
rsyncCmd => ['/usr/bin/ssh', '-i', '/path/to/myrsa',
'-l', 'root', '10.48.1.57', '/usr/bin/rsync'],
rsyncArgs => [
'-logDtpre.iLf',
'.',
],
});
$rs->remoteStart(0, '/root/files/');
$rs->go("$doc68_path/$file");
However on the server end by using an authorized_keys file with
command="echo $SSH_ORIGINAL_COMMAND >> /tmp/blah" ssh-rsa AAAAB3NzaC...
I see the command started is:
/usr/bin/rsync --server -logDtpre.iLf . .
It should be
/usr/bin/rsync --server -logDtpre.iLf . /root/files/
Below is what I *believe* it to be, even though my script doesn't work yet.
root@teamlotus:/usr/local/lib/perl5/site_perl/5.14.2/mach/File# diff
-u RsyncP.pm RsyncP.pm.new
--- RsyncP.pm 2012-09-17 16:35:08.708785866 +1000
+++ RsyncP.pm.new 2012-09-17 16:37:53.221677309 +1000
@@ -359,7 +359,7 @@
if ( $remoteSend ) {
push(@$cmd, ".", $remoteDir);
} else {
- push(@$cmd, ".");
+ push(@$cmd, $remoteDir);
}
}
$rs->log("Running: " . join(" ", @$cmd))