Nothing stupid about them...

...I just stole the name from David Letterman's "stupid pet tricks". I hope these tips help you avoid or fix mistakes along the way in your *nix administration duties.

Thursday, March 20, 2008

Quick action on multiple servers

I use this one at least five times per day.

$ for f in system1 system2 ... systemn
> do
> ssh -t $f somecommand
> done


It's a great, simple way to perform the same actions on many systems. If you have all your systems listed in a file, it's even simpler:

$ for f in `cat systemlist`
> do
> ssh -t $f somecommand
> done


By the way, the -t option to ssh is appropriate for any command that needs a tty.

No comments:

Search

Google