I am trying to run an application on multiple (~20) Unix servers. Rather than SSH’ing into each one individually, I would like to log in to one and use a script to start them all up.
The application does not require any direct user interaction, so I essentially just need to run ‘./app arg1 arg2’ on each machine.
One improvement on straight SSH is to start SSH session in the background and then
waitfor all of them to finish. This way you can execute command on remote servers simultaneously.We use this technique in our production scripts.
One thing to note, because all spawned processes are running simultaneously and using the same console, you may see some interleaved output on your screen.