How to Schedule Automatic Shutdown on Mac

Schedule automatic shutdown on Mac

With the arrival of MacOS Ventura -the latest version of the operating system for computers-, things get a bit complicated when it comes to automating the turning on/off of the Mac. schedule automatic shutdown on Mac we will have to resort to 'Terminal' to be able to execute some commands like the ones that we are going to explain below.

Apple decided to make some changes in its latest version of the operating system for Mac. From the shortcuts that could be seen in the previous versions, we had an icon that referred to 'Battery' or 'Battery saving'. From there we could program the suspension or automatic start of our computers. But, for some unknown reason, although the ability to perform these actions is operational, they are no longer as intuitive as before. We will have to resort to writing commands.

If your Mac is running macOS Monterey or earlier

MacOS Monterey automatic shutdown Mac

As we have told you, if your Mac is running versions prior to MacOS Ventura, the ability to schedule automatic shutdown on Mac will be very easy. And it is that you only have to go to the menu of the upper bar and click on the manzanita. In the dropdown menu, click the mouse on 'System preferences'.

Now, among the different icons that appear on the screen, you must identify the one that refers to 'Energy saving' -usually represented with a light bulb or, in other versions, with a battery. Click on it.

On the next screen you only have to choose dates and times to turn your Mac on and off. Click on apply and you will have the action of programming the automatic shutdown on Mac ready.

If your Mac runs macOS Ventura- using the terminal

MacOS Ventura schedule automatic shutdown on Mac

However, things get complicated in MacOS Ventura, the most recent version of the operating system. And it is that the option that we have mentioned in the previous case has disappeared from the graphical interface. Therefore, we must be ourselves, with the typing of the pertinent commands, that we manage to carry out the different actions that we want. In this case: schedule automatic shutdown on Mac.

The first thing to do in this case is to call 'Port'. For this we can do it directly from the Launchpad, from the 'Applications' folder. Or, if we are more lovers of quick actions, we must press Command + space bar and then type 'Terminal'. We are already in Terminal. It is time to type the different actions.

First of all, we must tell you that the command we are going to use is 'pmset'. Likewise, the automatic shutdown on Mac will have to indicate the days of the week in which we want to carry out the action. And in the command line you must indicate them as follows:

  • Monday –> M
  • Martes –> T
  • Wednesday –> W
  • Thursday –> R
  • Friday –> F
  • Saturday –> S
  • Sunday –> U

Well, taking all this into account, we will explain what you can do with this command. And we warn you that you can not only schedule the automatic shutdown on Mac, but also wake it up, put it to sleep or turn it on.

Schedule automatic shutdown on Mac using 'pmset'

Well, our first mission will be to program our Mac so that it turns off at the time that we tell it and on the day -or days- that we choose. Ok, let's get to work (we recommend that you take a pencil and paper or copy and paste these commands somewhere on your computer):

sudo pmset repeat shutdown M 22:00:00

In the previous command we have made our Mac turn off automatically every Monday at 22:00 p.m. In case you want to do this for each day, the command to write would be the following:

sudo pmset repeat shutdown MTWRFSU 22:00:00

As you will have been able to verify, all the days of the week are placed in the typed command. Now, and if we wanted to cancel all this, the command to write would be the following:

sudo pmset repeat cancel

Now, let's say that what we want to do is schedule the automatic shutdown of Mac on a specific day, taking into account that the date must be written in the following format: Month/Day/Year – MM/DD/YY. The example that we are going to write would be that our Mac shuts down on April 25, 2023 at 22:15 p.m. Well, the result is the following:

sudo pmset schedule shutdown 04/25/23 22:15:00

What more actions you can do with the 'pmset' command

pmset Command for MacOS

This command that we have discussed throughout the article will also allow you other actions. And it is that the shutdown 'shutdown' can be changed by other actions:

  • Sleep –> Mac sleep
  • wake –> wake up the Mac
  • restart –> restart the Mac
  • poweron –> Mac boot

Therefore, you will have as many possibilities as you want with this command. Now, remember the command line well if you want it to take effect. Also -and as Apple recommends-, before getting up from the chair and leaving the screen, remember to save all the changes in the applications that you have used.

Create a timer on a Mac with 'Terminal'

Terminal on macOS

Another of the options that we want to discuss with you is the possibility of your Mac turning off after a certain time; that is to say, that after a day you are the one who decides exactly when you want the Mac to turn off without having to do anything else. To do this, you must go back to 'Terminal' -we have already told you that you can launch it from Launchpad, Applications folder or with the keyboard shortcut-. Once the terminal is open, you must type the following:

sudo shutdown -h +45

In this command you must take into account that the command '-h' will allow you to set a timer, Whereas the '+45' refers to the number of minutes that will pass before the Mac shuts down. You can even set hours, but you will always have to change them to minutes. That is, if you want your Mac to shut down within 4 hours, you would type the following:

sudo shutdown -h +96

Next, when you press ENTER, you will be asked to enter your password as Administrator -don't worry because it does not appear on the screen-. After entering it, you will see that a countdown is established in which you will be informed that 'the system will turn off in 'X' time'. Among the different numbers that will appear on the screen, there will also be one that will refer to a PID. Save this numbering. Because? Well, because you will need it to deactivate the timer set in the following way:

sudo kill [PID numbering]

In 'PID numbering' you only have to enter the numbers and then press ENTER. You will also be asked for the password. When you finish and verify that you are the System Administrator, that command will be invalidated.

Likewise, in case you have been confused and have not written down the PID numberingDon't worry, because there is a remedy. You will be able to cancel the timer, although keep in mind that if you have set more than one timer, they will all be deleted. The command is the following:

sudo killall shutdown

If you want to know more about the command pmset, visit this page


Be the first to comment

Leave a Comment

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

*

*

  1. Responsible for the data: Actualidad Blog
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.