Send the same command to all SSH session

Adam adam at fastmail.com.au
Mon Jan 26 09:03:18 CET 2009



Mihamina Rakotomandimby (R12y) wrote:
> Adam wrote:
>> What command are you running. Is it something like:
>> ssh user at host "sudo apt-get update && sudo apt-get upgrade"
>
> The update/upgrade was just an example.
> I have plenty of other commands to send, espacially when problem comes.
Maybe I still misunderstand. Why would you have identical problems on
all your hosts? I can see why you may want to shutdown all your hosts or
run package updates simultaneously, and a script seems like the way to go.
> It's for a debug purpose. It may be tailing logs, checking disk space,
> displaying table of process, Ctrl-Cing, rebooting,...
I would do this kind of stuff with a script as well. You would need to
establish an ssh session to the individual hosts, execute a command
(passed as an argument to your script) and outputs the result to your
administering PC.


In general when I find myself performing repetitive tasks, writing a
script is usually answer.




More information about the Xfce mailing list