How to schedule your Mac to automatically shut down and wake up

Configure the Mac to automatically shut down or enter sleep mode on a schedule. Set it to wake and start up on a schedule too.

With a few simple commands you can schedule your Apple Mac to automatically shut down at night and wake in the morning ready to work. Save power and make your Mac envonmentally friendly.

Is your Mac sometimes left on when it does not need to be on? Do you find it running in the morning after someone forgot to shut it down the previous evening?

You can ensure your Mac is shut down at night by setting up a schedule that does it automatically. You can also schedule it to wake in the morning ready for you to start work.

It is common in companies for people to leave their computers on at the end of the day and they often are left idling all night. This at the very least wastes electricity and generates unwanted heat.

I have not seen any evidence that leaving a Mac running permanently shortens the life. Neither have I seen any evidence that shutting down and starting up shortens it. Some people argue the case for shutting down while others say leave it on. It does not seem to make much difference to its life.

I prefer to shut down at night, if only to save a bit of electricity and heat production.

You might want to read this introduction to power settings first: How to customise the power settings from Terminal

There are two ways to shut down and wake on a schedule and one is to use System Preferences and the other is to use Terminal commands that control the power management features.

Schedule sleep from System Preferences

The easy way to schedule the Mac to shut down in the evening and wake in the morning is to go to System Preferences and click Energy Saver. By setting the Computer sleep slider to 1 to 3 hours, the Mac will enter sleep mode when it is idle for a time, such as in the evening. This will not automatically wake it in the morning, but pressing the spacebar to wake it is easy enough.

Another way to automatically sleep and to wake the next day is to click the Schedule button in the bottom right corner of Energy saver preferences. There is a Start up or wake time and a Sleep, Restart or Shut Down time. Select the options you want and click OK.

Schedule sleep and wake in macOS on the Apple Mac

There are options to set the schedule for weekdays, weekends or a specific day in the week.

Schedule sleep and wake for the Apple Mac in System Preferences

Schedule sleep or wake from Terminal

System preferences is fine for most people, but all this can be done with commands in a Terminal window and there are a few extra options that make it a bit more flexible. If Energy Saver settings are not quite what you want, try the following commands from Terminal. Open it from the Utilities folder.

Here is the scheduling command:

pmset schedule TYPE TIME

TYPE = sleep, shutdown, wake, poweron, wakeorpoweron
TIME = date and time in the format “MM/DD/YY HH:MM:SS”

The following command is an example of its use and it shuts down the Mac at 10.30 PM on the 21st of September 2017:

sudo pmset schedule shutdown “09/21/17 22:30:00”

Let’s break this down:

Sudo = Needed because only admins can set power options
pmset = The power management command
schedule = Create a scheduled event
shutdown = The action - could use sleep, wake, poweron instead
“09/21/17 22:30:00” = The date and time

If you want to shut down at 10.30 PM every day,  the command is:

sudo pmset repeat shutdown MTWRFSU 22:30:00

M = Monday
T = Tuesday
W = Wednesday
R - Thursday
F = Friday
S = Saturday
U = Sunday

So the command to shut down every Monday, Wednesday and Friday at 9 PM would be:

sudo pmset repeat shutdown MWF 21:00:00

You can’t do that from System Preferences. Here you can select which days of the week the schedule applies to. It could be useful in some circumstances.

Set the Apple Mac to sleep or power off at a scheduled time

To wake the Mac at a specific time, don’t use wake or poweron, use wakeorpoweron because then it does not matter whether the Mac is sleeping or powered off.

sudo pmset repeat wakeorpoweron TRS 09:30:00

This powers up the Mac ready for work at 9.30 AM on Tuesday (T), Thursday (R) and Saturday (S). Note that if the Mac is powered off, it can only be powered on if it is connected to mains power.

Power on the Apple Mac at a set time using pmset from the Terminal

Check and clear the schedule

After experimenting with these scheduling and repeating power actions, you might wonder what the schedule is. To see the schedule, enter:

pmset -g sched

To clear the schedule, enter:

sudo pmset schedule cancelall

Need to know more? Read the manual! Type: man pmset



Add new comment

By submitting this form, you accept the Mollom privacy policy.

Related items you will like...