I would like to run one bash shell script on two or more machines simultaneously.Can I run one bash shell script on many machines simultaneously? I place this shell script on centos 5.5 and other machines run this simultaneously.
migrated from stackoverflow.com Nov 27 '12 at 8:09
This question came from our site for professional and enthusiast programmers.
My best bet would be using ssh. For this you probably need to exchange keys between your master machine (the one hosting the original script) and your slaves (the ones supposed to run the script). I.e. you need to do ssh-keygen on the master and append the contents of ~/.ssh/id_rsa.pub (or id_dsa.pub) on the master to ~/.ssh/authorized_keys on each slave. Then you can run a script sitting on the master on each slave like so:
(which is stolen from this answer).
Hope that helps.