Copying into two different folders on a machine simultaneously
I am trying to see is there any better way of doing the same thing using GNU Parallel instead of using &amp;.


Essentially you have two different commands and two different parameter lists:


Copy to PRIMARY, these files: 550 274 2 546 278
Copy to SECONDARY, these files: 1643 1103 1372 1096 1369 1568


These are two file-sets, two distinct operations. I don't think there's an easy way to do this with a single parallel process. A not-so-easy way can be:
organize the inputs in pairs, like this:

parallel -N2 do_Copy {1} {2} ::: 550 $PRIMARY 274 $PRIMARY 1643 $SECONDARY  # and so on


This way it will work with one command.
But constructing the argument list dynamically from your list of filenames will be tricky and potentially error prone.
The original solution is simple and easier to understand,
which are preferable properties.

Exporting variables

You don't need to export PRIMARY and SECONDARY.

You only need to export FILERS_LOCATION_1 and FILERS_LOCATION_2,
because these will be used by do_Copy,
which will be called by parallel (and also needs to be exported, as you correctly did).

Notice that the read-only FILERS_LOCATION array is pointless.
You could just as well set the FILERS_LOCATION_* variables directly:

export FILERS_LOCATION_1=machineB
export FILERS_LOCATION_2=machineC


Improving do_Copy

In this method,
you have two scp commands that are almost duplicates,
except the destination part.
To avoid the duplication,
you could just loop over the possible destinations,
and break out of the loop as soon as a copy was successful:

do_Copy() {
  el=$1
  PRIMSEC=$2
  for host in $FILERS_LOCATION_1 $FILERS_LOCATION_2; do
      echo "scp david@$host:$dir3/new_weekly_2014_"$el"_200003_5.data $PRIMSEC/." &amp;&amp; break
  done
}


If the destination files might be exactly the same as the local files,
then you'll be better off using rsync -u instead of scp,
to avoid unnecessary file transfers.