Results 1 to 4 of 4

Thread: auto shutdown

  1. #1
    Join Date
    Jun 2008
    Location
    NZ
    Posts
    1,569

    Default auto shutdown

    anybody know a good utility to schedule a shutdown of the computer unattended at a specified time?

  2. #2
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,402

    Default Re: auto shutdown

    Doing things unattended on a fixed time in a Unix/Linux environment is typically something to be done via cron.

    So first make a script that does what you want. An example:
    Code:
    #!/bin/bash
    shutdown -h now
    I personaly have a bit more elaborate script that tests if somebody is logged in or not, but that is up to what you exactly want.
    Let us give the script a place and a name. As this is to be run by root, login as root and go to root's bin directory:
    Code:
    henk@boven:~> su -
    Passwd:
    boven:~ # cd bin
    boven:~/bin #
    Use an editor (vim) to make the script (I will call it good-night).
    Then make it executable by it's owner (root):
    Code:
    chmod u+x good-night
    Then edit root's crontab with:
    Code:
    crontab -e
    and add a line like:
    Code:
    0 23 * * *    /root/bin/good-night
    which will run the script every day at 23:00.
    Henk van Velden

  3. #3
    Join Date
    Nov 2009
    Location
    Athens
    Posts
    13

    Default Re: auto shutdown

    a good utility is also kshutdown
    May the source be with us

  4. #4
    Join Date
    Jun 2008
    Location
    NZ
    Posts
    1,569

    Default Re: auto shutdown

    Quote Originally Posted by pad-fragos View Post
    a good utility is also kshutdown
    Thanks - that's the one I was after. I had used it in the past and couldn't remember the name - as obvious as the name is.

    Found it in the community repos.

Posting Permissions

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