On Wed, 2007-12-26 at 15:24 +0200, Shachar Shemesh wrote:
> Oded Arbel wrote:
> > I'm using ssh -f to background ssh so I can run the same operation
> > on multiple machines in parallel
> >   
> 
> > for server in 1 2 ...; do 
> >     ssh -f [EMAIL PROTECTED] 'run maintenance task'
> >     pids="$pids $(getSSHpid)"
> > done
> >
> > while kill -0 $pids 2>/dev/null; do echo "Waiting.."; sleep 1; done
> >
> >   
> Havn't checked it, but:
> for server in 1 2 ...
> do
>        ssh [EMAIL PROTECTED] 'run maintenance task' &
> done
> 
> should work.
> 
> In particular, running ssh with -f means that it backgrounds itself, and 
> thus the shell does not keep track over its process number. On the other 
> hand, running with & (assuming you don't need to put in a password) 

The problem is that I might need to put in the passwords (users that
expect to run these tasks will probably exchange keys with the servers,
but other users should be able to put in passwords - I don't want to
control that). I should have mentioned that.

-- 

Oded


=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to