LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   What is the easiest way to run a shell script in the background on 10 servers? (https://www.linuxquestions.org/questions/linux-software-2/what-is-the-easiest-way-to-run-a-shell-script-in-the-background-on-10-servers-627045/)

abefroman 03-10-2008 03:07 PM

What is the easiest way to run a shell script in the background on 10 servers?
 
What is the easiest way to run a shell script in the background on 10 servers?

I know you can do a for loop like:
for in server1 server2 ... server10; do `ssh -l root $i $cmd`; done;

but the script takes about a half hour to run, and the for loop won't go to the next server until one has finished.

Anyone know of a way to start the $cmd then go to the next server before it finishes?

jailbait 03-10-2008 04:28 PM

Quote:

Originally Posted by abefroman (Post 3084252)

What is the easiest way to run a shell script in the background on 10 servers?

I know you can do a for loop like:
for in server1 server2 ... server10; do `ssh -l root $i $cmd`; done;

but the script takes about a half hour to run, and the for loop won't go to the next server until one has finished.

Anyone know of a way to start the $cmd then go to the next server before it finishes?

You could try running each command in the background.

----------------
Steve Stites

matthewg42 03-10-2008 05:37 PM

Check out clusterssh: http://clusterssh.sourceforge.net/

abefroman 03-12-2008 09:24 AM

I tried cluster-ssh, dsh, and fanout

Couldn't get cluster-ssh to work via a remote connection to the terminal, dsh worked the same way as the for loop, and fanout worked perfectly:
http://www.stearns.org/fanout/README.html#fanout


All times are GMT -5. The time now is 04:43 AM.