The crontab of Linux commands

Source: Internet
Author: User

Format:

crontab [-u user] {-l |-r |-e}

The format of the crontab file is "M H d M D cmd".

where m stands for minutes (0~59), H for hours (0~23), D for Day (1~31), M for month (1~12), d for Day of week (0~6,0 for Sunday). CMD represents the program to be run, it is sent to sh execution, the shell only user, HOME, shell three environment variables.

Parameters:

-E: Executes the text editor to set the time table, the empty text editor is VI
-R: Delete the current schedule table
-l lists the current schedule table.

Example:

To view the cron settings for root: Crontab–u root–l

Delete root cron settings: Crontab–u root–r


#MIN       hour     day       MONTH   dayofweek       COMMAND

#每天早上6点10分

10    6      *     *     *     Date

#每两个小时

0     */2   *     *     *      Date

#晚上11点到早上8点之间每两个小时, 8 in the morning

0     23-7/2,8       *     *     *     Date

#每个月的4号和每个礼拜一到礼拜三的早上11点

0     11    4     *      1-3  Date

#1月1日早上4点

0     4      1     1       *  date

Crontab of Linux commands

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.