Benches macOS

6

Terminal Shutdown

apple Verified

Imported from the Apple Support Forums via the Wayback Machine 🔗

Hi Everyone,

Does anyone know how to use Terminal to schedule a system shutdown for/at a certain time?

Thanks

6 replies

Sign in or join Beachball Help to reply.

  1. 0

    nerowolfe

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Samsara wrote:

    Hi Everyone,

    Does anyone know how to use Terminal to schedule a system shutdown for/at a certain time?

    Thanks

    You can man shutdown and get all the details

    It would be

    shutdown -h time

    in which time is as follows

    time Time is the time at which shutdown will bring the system down and

    may be the word now (indicating an immediate shutdown) or specify

    a future time in one of two formats: +number, or yymmddhhmm,

    where the year, month, and day may be defaulted to the current

    system values. The first form brings the system down in number

    minutes and the second at the absolute time specified.

    If you wish to make this repetitive, say daily, you can incorporate the command into a simple script actuated at login or by iCal.

    Message was edited by: nerowolfe

  2. 0

    nerowolfe

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Camelot wrote:

    sudo pmset schedule shutdown "10/18/08 16:00:00"

    The above command will schedule a shutdown at 4pm on 10/18/08

    That's even better. In fact that command can schedule repeat events

    pmset repeat <type> <days of week> <time>

    <type> is one of: sleep, wake, poweron, shutdown, wakeorpoweron

    <date/time> is in "MM/dd/yy HH:mm:ss" format

    <time> is in "HH:mm:ss" format

    <days of week> is a subset of MTWRFSU

    [owner] optionally describes the event creator

    I am still learning.

  3. 0

    nerowolfe

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Samsara wrote:

    Hi Everyone,

    Does anyone know how to use Terminal to schedule a system shutdown for/at a certain time?

    Thanks

    You can man shutdown and get all the details

    It would be

    shutdown -h time

    in which time is as follows

    time Time is the time at which shutdown will bring the system down and

    may be the word now (indicating an immediate shutdown) or specify

    a future time in one of two formats: +number, or yymmddhhmm,

    where the year, month, and day may be defaulted to the current

    system values. The first form brings the system down in number

    minutes and the second at the absolute time specified.

    If you wish to make this repetitive, say daily, you can incorporate the command into a simple script actuated at login or by iCal.

    Message was edited by: nerowolfe

  4. 0

    Camelot

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    sudo pmset schedule shutdown "10/18/08 16:00:00"

    The above command will schedule a shutdown at 4pm on 10/18/08

  5. 0

    nerowolfe

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Camelot wrote:

    sudo pmset schedule shutdown "10/18/08 16:00:00"

    The above command will schedule a shutdown at 4pm on 10/18/08

    That's even better. In fact that command can schedule repeat events

    pmset repeat <type> <days of week> <time>

    <type> is one of: sleep, wake, poweron, shutdown, wakeorpoweron

    <date/time> is in "MM/dd/yy HH:mm:ss" format

    <time> is in "HH:mm:ss" format

    <days of week> is a subset of MTWRFSU

    [owner] optionally describes the event creator

    I am still learning.

  6. 0

    Samsara

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Thank you. Thank you both very much! 🙂