Linux script - How to!?

Bizkit87

Executive Member
Joined
Apr 3, 2009
Messages
5,254
Reaction score
421
Location
Somerset West
I'm want to create a shell script for some of our servers:

There are 10 servers, serv1 - serv10, now they all are the same [RHEL 5], and i want a script to perform an umount on all these servers:

so basically the script should go:

log in @ server 1 with root & password

do umount -l /folder

now log into server2 and repeat above until reaching server 10?

i've been going through here and here

but want to know what the best way to this would be, if possible and how :rolleyes:
 
The best solution would be to set up ssh with authorized_keys populated.
You can then run something like:
Code:
for servername in server1 server2 server3
do
ssh root@$servername umount -l /folder
done

Look here or at google for examples.
 
Top
Sign up to the MyBroadband newsletter
X