How to schedule your Mac to start up and shut down on its own


Apple’s new Mac Mini looks like someone hit the Mac Studio with a shrink ray, and I love it. But there is at least one, uh, hot-button issue: you have to reach underneath it to power it on. If that bothers you (and you’re not into flipping it upside down so it looks like it’s wearing a little hat), you can automate when it starts up and shuts down by creating a power schedule. I’ll tell you how.

There are plenty of reasons you might want to do this. I did it on my MacBook Air because I don’t use it that often, and I got tired of opening its lid only to find a dead laptop. Someone else might want their computer to wake up in the middle of the night to perform scheduled backups. Others might need to shut down their Mac for business reasons.

Once upon a time, you could create such a schedule using an easy settings menu in System Preferences. Sadly, that particular feature didn’t make the leap to macOS Ventura when Apple replaced System Preferences with the iOS-like System Settings app.

The good news is that, even after Apple got rid of its easy-to-use power schedule settings, you can still create the automations it enabled. The bad news is that you have to use Apple’s command line tool, Terminal, to do it. It’s a daunting task if you haven’t messed with command line interfaces, and Apple’s support instructions for setting up power scheduling this way aren’t very helpful. But don’t worry. I’ll describe how to do it below.

But first, a couple of notes.

Things to know

When using Terminal to set your Mac’s power schedule, you can’t enter the command for startup and shutdown separately — the Mac only honors one schedule, and it’s the last one you put in. So, if you try to set your startup time and then your shutdown time, it will only use the shutdown time. Instead, you’ll need to enter a single command.

Second, while it’s fun to use Terminal and pretend you’re a computer wizard, it can also be dangerous if you enter the wrong commands. The ones detailed below won’t do anything harmful, but you should never enter random commands if you don’t understand what they do. Here’s a website that explains much of the syntax you will use. (You can also type “man pmset” in Terminal to get a similar list.)

How to set up a macOS power schedule

The macOS Terminal app.
Screenshot: Apple

Unless you’ve moved it, Terminal should be located in the Utilities folder inside your Mac’s Applications folder. If you can’t find it, try pressing ⌘ (command) + spacebar to summon Spotlight search, type “Terminal,” and hit enter.

  • Set up a startup schedule

Below is the first part of your command, which sets what time you want your computer to start up every day. Type this in, but don’t hit enter yet, because there’s more to come.

sudo pmset repeat poweron

Next, you’ll set which days you want the schedule to run. If you only want weekdays, the next word in your string is just “weekdays,” without punctuation. Otherwise, each day is represented by a single letter. These are all entered in one chunk, without spaces between the letters. Here are the letter codes:

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

Next, you’ll enter the time, formatted as HH:MM:SS. For example, 7AM is 7:00:00 and 10AM is 10:00:00. Use 24-hour time. (If you’re not familiar with it, the easiest way to figure that out is to add 12 to the number, meaning that 1PM would be 13:00:00.)

What it might look like if you only want to set a startup schedule.
Screenshot: Apple

So, if you want your computer to boot up at, say, 7AM every weekday, the command would look like this:

sudo pmset repeat poweron weekdays 7:00:00

And for specific days — let’s say Wednesday through Sunday — this is what you’d enter:

sudo pmset repeat poweron WRFSU 7:00:00

If you don’t want to add a shutdown schedule, then you’re done and can hit enter now. (Terminal may require a password here — it’s the same one you use at your computer’s login screen.) Otherwise, continue to the next step.

An example of a startup / shutdown schedule in Terminal.
Screenshot: Apple

To add a shutdown time, you’ll add the word “shutdown” to the end of that string, followed by the days and times you want that to happen. When you’re done, your schedule might look like this (notice you’re powering up Wednesday though Sunday at 7AM and shutting down daily at 1AM):

sudo pmset repeat poweron WRFSU 7:00:00 shutdown MTWRFSU 1:00:00

After you’ve set up the schedule the way you want it, you can finally hit enter.

A couple of useful hints

  • Clearing your power schedule

You might find that automating your computer’s startup and shutdown time doesn’t suit your needs, and you’d like to remove the instructions. You can easily clear your schedule by typing the following:

To double-check that you set up the schedule the way you wanted, type this command and press enter:

  • If it doesn’t shut down

One last thing: sometimes, one or more apps will prevent your shutdown from happening, such as if you have unsaved work, and your computer will simply remain in sleep mode, waiting for you to do something about the open apps. You can still schedule your computer to wake from sleep, using the phrase “wakeorpoweron” — like so:

sudo pmset repeat shutdown MTWRFSU 1:00:00 wakeorpoweron MTWRF 7:00:00

And that’s it! Now, your computer should shut down and power up all on its own, and you can reap the power-saving benefits of your fancy new automation!



Source link


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *