Index: /tags/ipp-pv3-20140717/ippScripts/scripts/sc_transfer_tool.pl
===================================================================
--- /tags/ipp-pv3-20140717/ippScripts/scripts/sc_transfer_tool.pl	(revision 37323)
+++ /tags/ipp-pv3-20140717/ippScripts/scripts/sc_transfer_tool.pl	(revision 37324)
@@ -58,4 +58,5 @@
 my $fetch = 0;
 my $offset = 0;
+my $retry = 0;
 my $quickfetch = 0;
 
@@ -66,4 +67,5 @@
     'fetch'       => \$fetch,
     'verbose'     => \$verbose,
+    'retry'       => \$retry,
     'quickfetch'  => \$quickfetch,
     ) or pod2usage( 2 );
@@ -88,75 +90,78 @@
     $remote_file = "$input_path.return";
 }
-
-# open the input file list
-open (LOCAL,$local_file) || die "Couldn't find input file specified $local_file\n";
-open (REMOTE,$remote_file) || die "Couldn't find input file specified $remote_file\n";
-
-# generate N output files (to be fed to the N rsync / tar threads)
 my $input_base = basename($local_file);
-my @filehandles;
+
+unless ($retry) {
+  # open the input file list
+  open (LOCAL,$local_file) || die "Couldn't find input file specified $local_file\n";
+  open (REMOTE,$remote_file) || die "Couldn't find input file specified $remote_file\n";
+  
+  # generate N output files (to be fed to the N rsync / tar threads)
+  my @filehandles;
+  my $i;
+  my $line = 0;
+  for ($i = 0; $i < $threads; $i++) {
+      open($filehandles[$i], ">${local_tmp}/${input_base}.${i}");
+  }
+  
+  unless ($fetch) {
+      my $stat_file = "$input_path.stat";
+      print "STATFILE: $stat_file\n";
+      open (STATFILE, ">$stat_file");
+  }
+  
+  $i = 0;
+  while (my $Lname = <LOCAL>) {
+      my $Rname = <REMOTE>;
+  
+      chomp $Lname;
+      chomp $Rname;
+  
+      $line++;
+      if ($line < $offset) { next; } # I think this is off-by-one in a safe direction
+  
+      if ($line % 250 == 0)  { print STDERR "line $line : $Lname\n"; }
+  
+      $i = int(rand($#filehandles + 1));
+      if ($i >= $threads) {
+  	print STDERR "HUH: impossible file handle?\n";
+  	die;
+      }
+  
+      # if we are fetching, and 'quickfetch' is requested, skip file if it exists
+      # NOTE: this does not check that the transfer was complete or the file is current
+  
+      if ($fetch) {
+  	# We are fetching, and do not already have this file.
+  	if ($quickfetch && (-e $Lname)) { next; }
+  	print { $filehandles[$i] } "$Rname\n";
+      } else { 
+  	# We are pushing, but only send back files we actually have
+  	# we cannot have the remote file unless the local file exists 
+  	# (it is a link to the local file and is generated after the local file)
+  	my $haveRemote = -e "$local_tmp/$Rname";
+  	if ($haveRemote) {
+  	    print { $filehandles[$i] } "$Rname\n";
+  	    print STATFILE "$Rname PASS\n";
+  	} else {
+  	    my $haveLocal = -e $Lname;
+  	    if ($haveLocal) {
+  		print STATFILE "$Rname PART\n";
+  	    } else {
+  		print STATFILE "$Rname FAIL\n";
+  	    }
+  	}
+      }
+  }
+  close(LOCAL);
+  close(REMOTE);
+  unless ($fetch) { close(STATFILE); }
+  
+  for ($i = 0; $i < $threads; $i++) {
+      close($filehandles[$i]);
+  }
+}
+
 my $i;
-my $line = 0;
-for ($i = 0; $i < $threads; $i++) {
-    open($filehandles[$i], ">${local_tmp}/${input_base}.${i}");
-}
-
-unless ($fetch) {
-    my $stat_file = "$input_path.stat";
-    print "STATFILE: $stat_file\n";
-    open (STATFILE, ">$stat_file");
-}
-
-$i = 0;
-while (my $Lname = <LOCAL>) {
-    my $Rname = <REMOTE>;
-
-    chomp $Lname;
-    chomp $Rname;
-
-    $line++;
-    if ($line < $offset) { next; } # I think this is off-by-one in a safe direction
-
-    if ($line % 250 == 0)  { print STDERR "line $line : $Lname\n"; }
-
-    $i = int(rand($#filehandles + 1));
-    if ($i >= $threads) {
-	print STDERR "HUH: impossible file handle?\n";
-	die;
-    }
-
-    # if we are fetching, and 'quickfetch' is requested, skip file if it exists
-    # NOTE: this does not check that the transfer was complete or the file is current
-
-    if ($fetch) {
-	# We are fetching, and do not already have this file.
-	if ($quickfetch && (-e $Lname)) { next; }
-	print { $filehandles[$i] } $Rname;
-    } else { 
-	# We are pushing, but only send back files we actually have
-	# we cannot have the remote file unless the local file exists 
-	# (it is a link to the local file and is generated after the local file)
-	my $haveRemote = -e "$local_tmp/$Rname";
-	if ($haveRemote) {
-	    print { $filehandles[$i] } "$Rname\n";
-	    print STATFILE "$Rname PASS\n";
-	} else {
-	    my $haveLocal = -e $Lname;
-	    if ($haveLocal) {
-		print STATFILE "$Rname PART\n";
-	    } else {
-		print STATFILE "$Rname FAIL\n";
-	    }
-	}
-    }
-}
-close(LOCAL);
-close(REMOTE);
-unless ($fetch) { close(STATFILE); }
-
-for ($i = 0; $i < $threads; $i++) {
-    close($filehandles[$i]);
-}
-
 # fork the rsync
 my @pids = ();
@@ -207,5 +212,5 @@
     my $option = $server_options{$destination_host};
 
-    my $command = "rsync -Lt --omit-dir-times -e '$ssh_cmd ${option}' --files-from=${transfer_filelist} ${local_tmp} ${destination_host}:/";
+    my $command = "rsync -Lt --size-only --omit-dir-times -e '$ssh_cmd ${option}' --files-from=${transfer_filelist} ${local_tmp} ${destination_host}:/";
     print STDERR "$command\n";
     
@@ -243,5 +248,5 @@
     my $option = $server_options{$destination_host};
 
-    my $command = "rsync -e '$ssh_cmd ${option}' --files-from=${transfer_filelist} ${destination_host}:/ ${local_raw}";
+    my $command = "rsync --size-only -e '$ssh_cmd ${option}' --files-from=${transfer_filelist} ${destination_host}:/ ${local_raw}";
     print STDERR "$command\n";
 
@@ -254,9 +259,9 @@
 	warn("Transfer of files in $transfer_filelist from $destination_host failed with error ($error_code) $error_msg.");
 	print "*** stdout: *** \n";
-	foreach $line (@$stdout_buf) {
+	foreach my $line (@$stdout_buf) {
 	    print STDERR "stdout: $line\n";
 	}
 	print "*** stderr: *** \n";
-	foreach $line (@$stderr_buf) {
+	foreach my $line (@$stderr_buf) {
 	    print STDERR "stderr: $line\n";
 	}
