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