From 4c33a30a5b17364c74eec958204b568284b5b062 Mon Sep 17 00:00:00 2001 From: lissav Date: Wed, 9 Mar 2011 13:59:46 +0000 Subject: [PATCH] fix support for rsync options git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@9017 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-client/bin/prsync | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/xCAT-client/bin/prsync b/xCAT-client/bin/prsync index dd5f2c2fb..39bba9484 100755 --- a/xCAT-client/bin/prsync +++ b/xCAT-client/bin/prsync @@ -16,6 +16,7 @@ use Thread qw(yield); use Getopt::Long; use POSIX qw(:signal_h :errno_h :sys_wait_h); my $interface; +my $opts; Getopt::Long::Configure("require_order"); Getopt::Long::Configure("posix_default"); Getopt::Long::Configure("no_gnu_compat"); @@ -36,6 +37,7 @@ if (!(@ARGV)) { if (!GetOptions( 'h|help' => \$help, 'v|version' => \$version, + 'o|options=s' => \$opts, 'i|interface=s' => \$interface)) { &usage; @@ -112,7 +114,7 @@ foreach (@nodes) { while ($children > $pshmaxp) { processoutput($inputs); } my $child; $children++; - scpnode(\$child,$node,@ARGV[0],$destloc); + scpnode(\$child,$node,@ARGV[0],$destloc,$opts); $inputs->add($child); $nodehdl{$child} = $node; } @@ -149,11 +151,14 @@ sub scpnode { #my $args = join(" ",@_); my $file = shift; my $dest = shift; - open($$out,"rsync -az $file $node:$dest 2>&1 |"); + my $opts = shift; + my $cmd="rsync -az$opts $file $node:$dest 2>&1 |"; + open($$out,"rsync -az$opts $file $node:$dest 2>&1 |"); } sub usage { print "Usage: prsync filename [filename ...] noderange:destinationdirectory\n"; - print " prsync [rsync-opts] [filename filename ...] [directory directory ...]\n"; - print " noderange:destinationdirectory\n"; + print " prsync [-o rsync options] [filename filename ...] [directory directory ...]"; + print " noderange:destinationdirectory\n"; print " prsync {-h|--help|-v|--version}\n"; } +