Using Crontab to create timed tasks under Linux

Source: Internet
Author: User

To start the crontab service in Linux:

/etc/init.d/crond start

Crontab's command format

CRONTAB-L Displays the current crontab file (the crontab file that is written by default is saved in (/var/spool/cron/user name, for example:/var/spool/cron/roger)

Crontab-r Delete the current crontab (use this method sparingly, as all scheduled tasks will be removed)

CRONTAB-E editing the current crontab file using the editor

Crontab file Format:

Minutes hour day-of-month month-of-year Day-of-week commands

For example:

0 4 * * 2,5/USR/BIN/WALL</ETC/MOTD

Explanation: Information ************************************************ in the broadcast/etc/motd of the week of Tuesday and Friday

*/2 12-14 * 3-6,9-12 1-5 bash_scripts

Explanation: Every two minutes of 3-June, and 9-December Monday to Friday in the afternoon 12-14, a script is executed * * * *

Crontab's configuration file is placed in/etc/crontab

Using Crontab to create timed tasks under Linux

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.