Find the answer to your Linux question:
Results 1 to 5 of 5
I have 20 machines running on linux and am finding difficult in shutting down down one by one. can someone help me write a script that will shut them all ...
  1. #1
    Just Joined!
    Join Date
    Apr 2011
    Location
    Nairobi Kenya
    Posts
    0

    Remote shutdown of machines

    I have 20 machines running on linux and am finding difficult in shutting down down one by one. can someone help me write a script that will shut them all from one machine? i will be so greateful for your assistance.

  2. #2
    Linux Enthusiast Mudgen's Avatar
    Join Date
    Feb 2007
    Location
    Virginia
    Posts
    622
    I have one machine with a PKI trust set up in root's authorized_keys on the others. With a list of server names, one per line, I use a script like:
    grep -v "^#" servers.txt|while
    read node
    do
    ssh root@$node "shutdown -h 0"
    done

  3. #3
    Just Joined!
    Join Date
    Nov 2007
    Location
    Bangkok, Thailand
    Posts
    0
    Quote Originally Posted by sktoo View Post
    I have 20 machines running on linux and am finding difficult in shutting down down one by one. can someone help me write a script that will shut them all from one machine? i will be so greateful for your assistance.

    I am using Ubuntu and use a program called gshutdown. If you Google gshutdown you will find there site, sorry cant post it here as that is not allowed. Appears to work OK.

  4. #4
    Linux User
    Join Date
    Jan 2005
    Location
    Saint Paul, MN
    Posts
    260
    Or google for "clustersh".

  5. #5
    Linux Enthusiast Mudgen's Avatar
    Join Date
    Feb 2007
    Location
    Virginia
    Posts
    622
    Quote Originally Posted by alf55 View Post
    Or google for "clustersh".
    I think you meant clusterssh. Pretty much replicates in a gui what I described for command line, but at a host key level of trust, if that satisfies your needs better.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •