how to auto shutdown Linux at a specific time?

Discussion in 'all things UNIX' started by Konata Izumi, Mar 6, 2011.

Thread Status:
Not open for further replies.
  1. Konata Izumi

    Konata Izumi Registered Member

    Joined:
    Nov 23, 2008
    Posts:
    1,557
    how can I make linux (ubuntu) shutdown at a scheduled time?
    I prefer setting schedule be password protected. :D
     
  2. Mrkvonic

    Mrkvonic Linux Systems Expert

    Joined:
    May 9, 2005
    Posts:
    10,213
    Once time or recurring? You can use at or cron.

    In the console window, type man at or man cron to get info on how to use them. In general shutdown is a privileged command, so you will need to create this job as root (sudo).

    You can shutdown the system in many ways.
    Normal linuxes respect init levels (so you would issue init 0).

    Likewise, check man shutdown for the shutdown command use.
    It has its own timer, so if this is a once time, then you can use that.

    You can also specify which users are allowed to shutdown the machine under /etc/shudown.allow, so you won't need root/sudo for that.

    Mrk
     
  3. Konata Izumi

    Konata Izumi Registered Member

    Joined:
    Nov 23, 2008
    Posts:
    1,557
    for one time only. I will set new time daily.

    what are the commands I should type in terminal if for example I want to shutdown my PC at 9:00AM and the Desktop User Account is called "Anonymous"?

    sorry for asking to be spoonfed but I'm lost around the terminal part o_O


    OT: When I lock UBUNTU for a few hours and came back... Transmission (bittorrent) stopped running, Empathy on the other hand does not. Why is that? :<
     
    Last edited: Mar 7, 2011
  4. Mrkvonic

    Mrkvonic Linux Systems Expert

    Joined:
    May 9, 2005
    Posts:
    10,213
    If you're not comfortable with the command line yet - then do not run any commands you don't know, including shutdown. Please invest time reading and learning about this.

    Why your apps are stopped - there could be a million reasons.
    Have you googled your symptom or checked ubuntu forums?

    Mrk
     
  5. clansman77

    clansman77 Registered Member

    Joined:
    Jan 31, 2005
    Posts:
    234
    Location:
    kochi,kerala,india
    use gshutdown
     
  6. albsat

    albsat Registered Member

    Joined:
    Feb 10, 2011
    Posts:
    51
    shutdown -h 20

    p.s. in this case 20 equals to 20 minutes.
     
Thread Status:
Not open for further replies.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.