Linux crontab Command format
Basic format:
* * * * command
Time-sharing and Lunar Week command
The 1th column represents minutes 1~59 per minute with * or */1
The 2nd column represents the hour 1~23 (0 for 0 points)
The 3rd column represents the date 1~31
The 4th column represents the month 1~12
The 5th list of the week 0~6 (0 for Sunday)
6th column the command to run
Detailed examples
* * * */usr/local/etc/rc.d/lighttpd restart
The above example represents 21:30 restart Apache per night.
4 1,10,22 * */USR/LOCAL/ETC/RC.D/LIGHTTPD restart
The above example represents the 4:45 reboot of Apache for 1, 10, and 22nd per month.
1 * * 6,0/USR/LOCAL/ETC/RC.D/LIGHTTPD restart
The above example shows the 1:10 reboot of Apache every Saturday and Sunday.
0,30 18-23 * * * */usr/local/etc/rc.d/lighttpd restart
The example above shows that Apache is restarted every 30 minutes from 18:00 to 23:00 every day.
0 * * 6/USR/LOCAL/ETC/RC.D/LIGHTTPD restart
The above example indicates that 11:00 PM restarts Apache every Saturday.
* */1 * * * */usr/local/etc/rc.d/lighttpd restart
Restart Apache every hour
* 23-7/1 * * * */usr/local/etc/rc.d/lighttpd restart
From 11 o'clock to 7 in the morning, restart Apache every hour.
0 4 * mon-wed/usr/local/etc/rc.d/lighttpd restart
4th per month with 11 points per Monday to Wednesday restart Apache
0 4 1/USR/LOCAL/ETC/RC.D/LIGHTTPD * Restart
Restart Apache at 4 o ' January 1.
Spring Quartz time Format * * * * * *
Second time and the anniversary of the moon
Detailed examples
0 0 12 * *? |
Triggered at 12 a day. |
0 15 10? * * |
Triggers 10:15 every day. |
0 15 10 * *? |
Triggers 10:15 every day. |
0 15 10 * *? * |
Triggers 10:15 every day. |
0 15 10 * *? 2005 |
2005 Daily 10:15 Trigger |
0 * 14 * *? |
Every afternoon at 2 O ' 2:59, each minute triggers |
0 0/5 14 * *? |
Every afternoon at 2 O ' 2:59 (the whole point starts, every 5 minutes triggers) |
0 0/5 14,18 * *? |
Every afternoon at 2 O ' 2:59 (the whole point starts, every 5 minutes triggers) Every afternoon at 18 O ' 18:59 (the whole point starts, every 5 minutes triggers) |
0 0-5 14 * *? |
Every afternoon at 2 O ' 2:05, each minute triggers |
0 10,44 14? 3 WED |
March every Wednesday afternoon 2:10 and 2:44 triggering |
0 15 10? * Mon-fri |
From Monday to Friday every morning of 10:15 triggers |
0 15 10 15 *? |
15th per month, 10:15 A.M. trigger. |
0 L *? |
10:15 trigger on the last day of the month |
0 15 10? * 6L |
The last week of the month of Friday 10:15 Trigger |
0 15 10? * 6L 2002-2005 |
From 2002 to 2005 the last week of the month of Friday 10:15 triggered |
0 15 10? * 6#3 |
The third week of the month of Friday starts to trigger |
0 0 12 1/5 *? |
The first noon of the month starts every 5 days. |
0 11 11 11 11? |
Every November 11 11:11 trigger (Singles Day) |