Unix – Seqential Remote Calls to Several Machines

Copy Data to multiple machines

for i in 187 135; do
    echo "--server${i}--";
    scp -p -r /dev/mydata myuser@myhost${i}.net:/dev ;
done

Execute Scripts in multiple machines

Example 1

for i in 187 135; do
    echo "--server${i}--";
    ssh myuser@myhost${i}.net "chmod 777 /dev/mydata.sh;rm -r  /dev/main;" ;
done

Example 2
for i in 187 135; do
    echo "------de${i}--------";
    ssh myuser@myhost${i}.net 'ls -l /dev' ;
done

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *