Take control of your Mac's schedule using the Terminal

Sep 8, 2015 13:55 GMT  ·  By

Scheduling a Mac to wake up or shut down has become a trivial thing for any Mac user after Apple has included a simple-to-use interface within the Energy Saver preference pane in the OS X System Preferences.

Although trying to make things easier for its users, Apple has neglected to provide the means to create a custom power up or shut down schedule, such as setting your Mac to only wake up on Monday, Wednesday and Saturday at 8:00 a.m., and set it to power down each day at 23:00 p.m.

pmset to the rescue

In spite of this, there are ways to circumvent this problem using the pmset command-line program. This little tool makes it possible to easily manipulate your Mac's power management settings, allowing you to rapidly create a simple wake up and shut down plan using the Terminal.

More importantly, with the help of pmset you can set your Mac to wake or power off on any day of the week, not only on weekdays, on weekends or each day of the week, but also using a more complex scheme such as a combination of weekdays and weekends.

Such a power on and off timetable might prove very useful for people with a complicated schedule and who might want to have their Macs waiting for them ready for work.

The schedule creation procedure

The only thing you have to do before creating a new schedule for your Mac is to open a Terminal window by pressing the ⌘ + SPACE keyboard shortcut to open Spotlight, writing "Terminal" and hitting ⏎ (ENTER).

Next, you will have to run the following command as root (to do this you must have access to your Mac's root password) to schedule the Mac to power or shut down on the days you want:

code
sudo pmset repeat wakeorpoweron MWFU 07:30:00 shutdown MWRSU 22:00:00
In the example above, I set my Mac to wake up at 7:30 a.m. on Monday, Wednesday, Friday and Sunday, and to shut down on Monday, Wednesday, Thursday, Saturday and Sunday at 10:00 p.m..

If you want to use another set of days that matches your timetable, you can create a custom array of days using each day's corresponding symbol from the following abbreviated day list:

Day Code
Monday M
Tuesday T
Wednesday W
Thursday R
Friday F
Saturday S
Sunday U

Custom shut down / wake up schedule (2 Images)

The Schedule drop-down dialog from the Energy Saver prefpane
Running pmset in the Terminal and reviewing the resulting schedule
Open gallery