How to set a timer shutdown, restart, sleep method

Source: Internet
Author: User
Tags sleep

first, directly to set up

Open System Preferences-Energy saver, then click on the "Timed" button, check the second checkbox (the one in front of the sleep), then select Shutdown/reboot/sleep in the Pull-down menu, and set the time on the right.

  Second, use Terminal command to set up

For example: Set September 3, 2012 23:15 shutdown: sudo shutdown-h 1209032315 set September 3, 2012 23:15 points restart: sudo shutdown-r 1209032315 set September 3, 2012 23 : 15 minutes Sleep: sudo shutdown-s 1209032315

I believe we all understand, the main body of the command is shutdown,h/r/s to represent shutdown/reboot/Sleep, then add execution Time (YYMMDDHHMM) to the following.

Some fans may still have a problem: what if I want to temporarily cancel a timed shutdown/sleep/reboot? Actually, it is also very simple, or through an example to illustrate. For example, in the terminal we executed the September 3, 2012 23:15 shutdown command, the terminal will display the following:

Note that PID 577 above, this is the current running of the shutdown command of the process number, if you want to cancel shutdown, just want to stop the process of running on it. 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.