格式說明
分 時(shí) 日 月 星期 要運(yùn)行的命令
第1列分鐘1~59
第2列小時(shí)1~23(0表示子夜)
第3列日1~31
第4列月1~12
第5列星期0~6(0表示星期天)
第6列要運(yùn)行的命令
栗子
- 每晚的21:30重啟apache
30 21 * * * /usr/local/apache/bin/apachectl restart
- 表示每月1、10、22日的4 : 45重啟apache
45 4 1,10,22 * * /usr/local/apache/bin/apachectl restart
- 每周六、周日的1 : 10重啟apache
10 1 * * 6,0 /usr/local/apache/bin/apachectl restart
- 每天18 : 00至23 : 00之間每隔30分鐘重啟apache
0,30 18-23 * * * /usr/local/apache/bin/apachectl restart
- 每星期六的11 : 00 pm重啟apache
0 23 * * 6 /usr/local/apache/bin/apachectl restart
- 每一小時(shí)重啟apache
* */1 * * * /usr/local/apache/bin/apachectl restart
- 晚上11點(diǎn)到早上7點(diǎn)之間,每隔一小時(shí)重啟apache
* 23-7/1 * * * /usr/local/apache/bin/apachectl restart
- 每月的4號與每周一到周三的11點(diǎn)重啟apache
0 11 4 * mon-wed /usr/local/apache/bin/apachectl restart
- 一月一號的4點(diǎn)重啟apache
0 4 1 jan * /usr/local/apache/bin/apachectl restart