Permalink
Browse files

added rsync archive, update and compress mode

  • Loading branch information...
1 parent a51cd0f commit d32a293986667d1686cb0ba17d0061b73616fe0d @liseen liseen committed Oct 26, 2010
Showing with 35 additions and 2 deletions.
  1. +1 −1 bin/atnodes
  2. +28 −1 bin/tonodes
  3. +6 −0 t/tonodes.t
View
@@ -335,7 +335,7 @@ atnodes - Run commands on clusters
-u <user> User account for SSH login.
-v Be verbose.
-w Prompt for password (used for login and sudo).
- -tty Pseudo-tty.
+ -tty Use pseudo-tty.
=head1 PREREQUISITES
View
@@ -26,6 +26,11 @@ my $fetch_value;
my $found_sep;
my $last_option;
my $line_mode = $ENV{SSH_BATCH_LINE_MODE};
+
+my $rsync_archive;
+my $rsync_update;
+my $rsync_compress;
+
for (@ARGV) {
if (defined $fetch_value) {
$fetch_value->($_);
@@ -62,6 +67,12 @@ for (@ARGV) {
$fetch_value = sub { $bwlimit = shift };
} elsif ($group eq 'rsync') {
$use_rsync = 1;
+ } elsif ($group eq 'archive') {
+ $rsync_archive = 1;
+ } elsif ($group eq 'update') {
+ $rsync_update = 1;
+ } elsif ($group eq 'compress') {
+ $rsync_compress = 1;
} elsif ($group eq 'c') {
$fetch_value = sub { $concurrency = shift };
} elsif ($group eq 'L') {
@@ -223,6 +234,10 @@ while (1) {
async => 1,
defined $recursive ? (recursive => $recursive) : (),
defined $bwlimit ? (bwlimit => $bwlimit) : (),
+
+ defined $use_rsync && defined $rsync_archive ? (archive => 1) : (),
+ defined $use_rsync && defined $rsync_update ? (update => 1) : (),
+ defined $use_rsync && defined $rsync_compress ? (compress => 1) : (),
# XXX recursive
}, @files, $target_path);
if (!defined $pid or $pid == -1) {
@@ -320,6 +335,9 @@ OPTIONS:
-p <port> Port for the remote SSH service.
-r Recurse into directories too.
-rsync Use "rsync" to transfer files.
+ -archive Enable rsync archive mode
+ -update Enable rsync update
+ -compress Enable rsync compress
-t <timeout> Specify timeout for net traffic.
-u <user> User account for SSH login.
-v Be verbose.
@@ -346,10 +364,14 @@ tonodes - Upload local files/directories to remote clusters
$ tonodes /tmp/*.inst -- '{as}:/tmp/'
$ tonodes foo.txt 'ws1105*' :/tmp/bar.txt
+ $ tonodes -r /opt /bin/* -- 'ws[1101-1102].foo.com' 'bar.com' :/foo/bar/
+
# use rsync instead of scp:
$ tonodes foo.txt 'ws1105*' :/tmp/bar.txt -rsync
- $ tonodes -r /opt /bin/* -- 'ws[1101-1102].foo.com' 'bar.com' :/foo/bar/
+ # use rsync archive update compress
+ $ tonodes foo.txt 'ws1105*' :/tmp/bar.txt -rsync -archive -update -compress
+
=head1 USAGE
@@ -373,6 +395,11 @@ tonodes - Upload local files/directories to remote clusters
-v Be verbose.
-w Prompt for password (used mostly for login and sudo).
+ -rsync Use "rsync" to transfer files.
+ -archive Enable rsync archive mode
+ -update Enable rsync update
+ -compress Enable rsync compress
+
=head1 DESCRIPTION
Please refer to L<SSH::Batch> for more documentation.
View
@@ -56,6 +56,9 @@ OPTIONS:
-p <port> Port for the remote SSH service.
-r Recurse into directories too.
-rsync Use "rsync" to transfer files.
+ -archive Enable rsync archive mode
+ -update Enable rsync update
+ -compress Enable rsync compress
-t <timeout> Specify timeout for net traffic.
-u <user> User account for SSH login.
-v Be verbose.
@@ -158,6 +161,9 @@ OPTIONS:
-p <port> Port for the remote SSH service.
-r Recurse into directories too.
-rsync Use "rsync" to transfer files.
+ -archive Enable rsync archive mode
+ -update Enable rsync update
+ -compress Enable rsync compress
-t <timeout> Specify timeout for net traffic.
-u <user> User account for SSH login.
-v Be verbose.

0 comments on commit d32a293

Please sign in to comment.