Mac Set timer shutdown, restart, sleep

Source: Internet
Author: User
Tags min sleep

One user consulted about the ability to set a timed shutdown for a Mac. In fact, OS X system comes with this related function, but "hidden" a bit deep. Here to share with you:

Open System Preferences-Energy saver, then click on the "Timing" button;

Tick the second check box (the one in front of sleep) and select Shut Down/restart/sleep in the dropdown menu;

Set the time on the right.

Note: The above methods are tested under OS X Mountain Lion 10.8 System, and other versions of OS X systems may be slightly different.

However, this can only be done by setting the periodic loop. That is, there is no way to set "execute only once". If you want to set a timed shutdown/restart/sleep only once in a while, you can use terminal commands to resolve it. Here are some examples:

Set September 5, 2012 23:15 minute shutdown: sudo shutdown-h 1209052315

Set September 5, 2012 23:15 min Restart: sudo shutdown-r 1209052315

Set September 5, 2012 23:15 min sleep: sudo shutdown-s 1209052315

I believe we all understand, the main body of the command is SHUTDOWN,H/R/S respectively represents shutdown/restart/sleep, and then add the execution time (YYMMDDHHMM) can be followed.

Some fans may still have a problem: what if I want to temporarily cancel my scheduled shutdown/sleep/restart? It is also very simple, and it is illustrated by examples. For example, we executed the command in the terminal for the September 3, 2012 23:15 sub-shutdown, which appears as follows:

mbp:~ $ sudo shutdown-h 1209052315

Shutdown at Mon Sep 5 23:15:00 2012.

Shutdown: [PID 577]

Note the above PID 577, this refers to the current run of the shutdown command process number, if you want to cancel the shutdown, only need to stop the process of running it. The command is:

sudo kill 577

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.