Never been to CodeSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

ssh remote systems (See related posts)

// This little gem enables me to execute commands on a group of systems
// just run this script and put whatever commands you want after it.. eg
// script.sh uname -a
// and it will execute 'uname -a' on all the listed hosts. make sure you setup
// ssh keys so you don't have to type in a bunch of passwords.

#!/bin/bash
HOSTLIST="web2 web3 web4 vm1 dev"
USER="mylogin"

for H in $HOSTLIST; do
        echo -n "$H: " && ssh $USER@$H $*
done  

Comments on this post

jamiew posts on Feb 06, 2008 at 18:02
FYI check out Capistrano or Vlad the Deployer for any kind of complex deployments
dallas posts on Feb 08, 2008 at 01:20
Hi jamiew,

Thanks for your advice. I stumbled upon cfengine the other day and am looking at it as well.
dallas

You need to create an account or log in to post comments to this site.