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

Re: copy one file, multiple machines



On 6/3/05, Jacob S <stormspotter@6texans.net> wrote:
> #!/bin/bash
> 
> MACHINES="hostname1 hostname2 ip.add.ress.3 hostname4"
> 
> for MACHINE in $MACHINES ; do
> 
>   scp script_filename_sh $MACHINE:/etc/cron.daily/
> 
> done
> 

if you had a key for your machines, you would use this command:

KEY="/my/master/key/id_dsa"
MACHINES="hostname1 hostname2 ip.add.ress.3 hostname4"

for $MACHINE in $MANCHINES
 do
   scp -i $KEY file.to.copy $MACHINE:/etc/cron.daily/
 done

cheers!
diego
-- 
___Diego Martínez Castañeda
_________n1mh  @ n1mh.org
_______http://www.n1mh.org

Trabaja como si no necesitaras el dinero. Ama como si nunca te
hubieran herido. Baila como si nadie te estuviera mirando.



Reply to: