Ubuntu uses scheduled tasks to implement timed shutdown and reminders

Source: Internet
Author: User

First confirm that Ubuntu has been installed and runs crond:

Harry @ ubuntu :~ $ Sudo service cron status
Cron start/running, process 923

We will use producer Y-send to send the pop-up prompt message of bubbling and confirm whether to install it:

Harry @ ubuntu :~ $ Sending y-send-help

If not, install:

Harry @ ubuntu :~ $ Sudo apt-get install libnotify-bin

Then set the cron scheduled task:

Harry @ ubuntu :~ $ Sudo crontab-e

Select an editor and enter:

50 23 ***/sbin/shutdown-h 23:55

50 23 *** export DISPLAY =: 0.0; su-harry-c "Your Y-send-I/usr/share/icons/Humanity/emblems/48/emblem-danger.svg parent, it's time to wash and sleep !! In 5 minutes, www.111cn.net will be automatically shut down ""
53 23 * export DISPLAY =: 0.0; su-harry-c "Your Y-send-I/usr/share/icons/Humanity/emblems/48/emblem-danger.svg parent, it's time to wash and sleep !! Will automatically shut down in 2 minutes ""

Change the harry user name to your own. DISPLAY specifies the output terminal device. The pop-up reminder background icon can be set by yourself. Restart crond after setting:

Sudo service cron restart

PS: If there are 100,000 urgent events, you need to cancel automatic shutdown: sudo shutdown-c. There is also a simple and useful small software gnome-typing-monitor that comes with Ubuntu. This tool can be used to set a timed lock on the computer screen to remind you to wait for a while before working, set it here (UBUNTU 11.04 ):

System settings-> hardware-> keyboard-> Typing Break check Lock Screen to enforce typing break to set the Lock interval and duration.

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.