I'm trying to run a script on multiple remote servers, with multiple parameters. The GNU parallel command is:
parallel --onall -S ${RH32},{RH64} /shared/loc/script.sh ::: param1 param2
script.sh:
host=`uname -n`
param=$1
logfile=/shared/loc/log-$host-$param
for i in `seq 1 5`; do
touch ${logfile}_$i
sleep 2
done
I'm trying to achieve a run on 4 processes in parallel:
- rh32 running script.sh with param1
- rh32 running script.sh with param2
- rh64 running script.sh with param1
- rh64 running script.sh with param2
When looking at the output as it accumulates it appears that what really happens is this:
- rh32 running script.sh with param1
- rh64 running script.sh with param1
-are being run in in parallel. When they finish, the other two are being run in parallel.
How can I make all four of them run in parallel at the same time?
Thanks,