I am trying to run a script on multiple remote servers with multiple parameters. GNU parallel command:
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 try to execute 4 processes in parallel:
- rh32 script.sh with parameter
- rh32 script.sh with parameter
- rh64 runs script.sh with the parameter
- rh64 runs script.sh with parameter2
When viewing the output, when it accumulates, it appears what really happens:
- rh32 script.sh with parameter
- rh64 runs script.sh with the parameter
- performed in parallel. When they finish , the other two are executed in parallel.
How can I make all four of them work in parallel at the same time?
Thanks,
source
share