support fanout input
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@13044 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
		@@ -28,7 +28,6 @@ if ($ENV{XCATHOST}) {
 | 
			
		||||
          $xcathost=$ENV{XCATHOST};
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
my $pshmaxp = 64; #TODO: should this be server dictated or local conf?
 | 
			
		||||
if (!(@ARGV)) {
 | 
			
		||||
       &usage;
 | 
			
		||||
       exit(1);
 | 
			
		||||
@@ -38,6 +37,7 @@ if (!GetOptions(
 | 
			
		||||
  'h|help'     => \$help,
 | 
			
		||||
  'v|version'  => \$version,
 | 
			
		||||
  'o|options=s' => \$opts,
 | 
			
		||||
  'f|fanout=s' => \$fanout,
 | 
			
		||||
  'i|interface=s'  => \$interface))
 | 
			
		||||
{
 | 
			
		||||
       &usage;
 | 
			
		||||
@@ -52,7 +52,14 @@ if ($version) {
 | 
			
		||||
    print "$version \n";
 | 
			
		||||
    exit(0);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
my $pshmaxp = 64; 
 | 
			
		||||
# determine fanout
 | 
			
		||||
if ($fanout) {  # see if they overroad the fanout from the command line
 | 
			
		||||
  $pshmaxp=$fanout;
 | 
			
		||||
}
 | 
			
		||||
if ($ENV{XCATPSHFANOUT}) {  # env variable rules
 | 
			
		||||
  $pshmaxp=$ENV{XCATPSHFANOUT};
 | 
			
		||||
}
 | 
			
		||||
(my $noderange,my $destloc) = split(/:/,$ARGV[1]);
 | 
			
		||||
my @user = getpwuid($>);
 | 
			
		||||
my $homedir=$user[7];
 | 
			
		||||
@@ -159,7 +166,7 @@ sub scpnode {
 | 
			
		||||
}
 | 
			
		||||
sub usage {
 | 
			
		||||
    print "Usage: prsync filename [filename ...] noderange:destinationdirectory\n";
 | 
			
		||||
    print "       prsync  [-o rsync options] [filename filename ...] [directory directory ...]";
 | 
			
		||||
    print "       prsync [-f fanout]  [-o rsync options] [filename filename ...] [directory directory ...]";
 | 
			
		||||
    print "  noderange:destinationdirectory\n";
 | 
			
		||||
    print "       prsync {-h|--help|-v|--version}\n";
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -18,6 +18,7 @@ use POSIX qw(:signal_h :errno_h :sys_wait_h);
 | 
			
		||||
my $interface;
 | 
			
		||||
GetOptions(
 | 
			
		||||
  "interface=s" => \$interface,
 | 
			
		||||
  "f|fanout=s" => \$fanout,
 | 
			
		||||
  );
 | 
			
		||||
my %nodehdl;
 | 
			
		||||
my $xcathost='localhost:3001';
 | 
			
		||||
@@ -28,11 +29,18 @@ if ($ENV{XCATHOST}) {
 | 
			
		||||
sub usage
 | 
			
		||||
{
 | 
			
		||||
  print $_[0];
 | 
			
		||||
  print "Usage: pscp [-i <SUFFIX>] [SCP OPTIONS...] FILE... <NODERANGE>:<DESTINATION>\n";
 | 
			
		||||
  print "Usage: pscp [ -f fanout] [-i <SUFFIX>] [SCP OPTIONS...] FILE... <NODERANGE>:<DESTINATION>\n";
 | 
			
		||||
  exit 1;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
my $pshmaxp = 64; #TODO: should this be server dictated or local conf?
 | 
			
		||||
my $pshmaxp = 64; 
 | 
			
		||||
if ($fanout) {  # see if they overroad the fanout from the command line
 | 
			
		||||
  $pshmaxp=$fanout;
 | 
			
		||||
}
 | 
			
		||||
if ($ENV{XCATPSHFANOUT}) {  # env variable rules
 | 
			
		||||
  $pshmaxp=$ENV{XCATPSHFANOUT};
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Processing arguments
 | 
			
		||||
usage unless @ARGV;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user