diff --git a/fastcopy.pl b/fastcopy.pl index b15c1109591b787265fa81924ff57fb8f7ff14df..db2848e76bf31c1b35c494cbf431c836bdd708ca 100755 --- a/fastcopy.pl +++ b/fastcopy.pl @@ -6,6 +6,8 @@ # Modules use strict; use Getopt::Long; +# Module to shuffle a list +use List::Util qw(shuffle); # Let unknown options pass through to @ARGV (so they can be forwarded to rsync) &Getopt::Long::Configure( 'pass_through'); # Use a signalhandler to work the finished childs @@ -19,6 +21,7 @@ my $sync_dir = ''; my @errors; my @seeds; my @sinks; +my @input_sinks; my %processes; my $rsync_settings = '--archive'; # Retrieve data from commandline @@ -38,7 +41,8 @@ GetOptions ( # First set the frontend as seed push (@seeds, `qconf -ss`); # Then the nodes as sinks -push (@sinks, `qconf -sel`); +push (@input_sinks, `qconf -sel`); +@sinks=shuffle(@input_sinks); # Put the size of the sinks array in a variable $number_of_sinks=scalar(@sinks);