I have thousands of remote machines. I want to run some specific commands on all of them, but in parallel.
I use these commands which run sequentially:
for f in `cat host.lst`
do
./runScript.sh $f
done
Let's suppose host.lst contains 100 hosts. I want to run runScript.sh on 100 hosts in parallel. Also logs should be maintained.
I can not install any utility on my machine such as PSSH.
I have done a lot of research and found these links, but they did not help. I do not understand how they work:
Automatically run commands over SSH on many servers
Execute command on multiple files matching a pattern in parallel
Can anyone explain the logic?