[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: copy one file, multiple machines



On Fri, 03 Jun 2005 09:54:32 -0400
jmr_071769 <jmr_071769@comcast.net> wrote:

> howdy everyone.
> 
> this is more of a linux question. i have script_filename_sh that i'd
> like to copy to multiple /etc/cron.daily/ directories on our network.
> what's a nifty script that could save me from up-arrow'ing/scp'ing to
> death?
> 
> for instance:
> 
> scp script_filename_sh machine1:/etc/cron.daily/
> scp script_filename_sh machine2:/etc/cron.daily/
> 
> so on, so on... we have like 50 machines...

Do you have a list of the hostnames/ips handy? Something like this
should work:

#!/bin/bash

MACHINES="hostname1 hostname2 ip.add.ress.3 hostname4"

for MACHINE in $MACHINES ; do

  scp script_filename_sh $MACHINE:/etc/cron.daily/

done

HTH,
Jacob



Reply to: