1. 程式人生 > >crontab格式寫錯出現報錯

crontab格式寫錯出現報錯

                今天編輯crontab加入任務的時候,老是出現以下錯誤:
crontab: installing new crontab
"/tmp/crontab.XXXX6P2m6c":4: bad minute
errors in crontab file, can't install.
Do you want to retry the same edit? 
Enter Y or N
Do you want to retry the same edit? n
crontab: edits left in /tmp/crontab.XXXX6P2m6c


Do you want to retry the same edit?
Enter Y or N
Do you want to retry the same edit?
Enter Y or N
Do you want to retry the same edit?
Enter Y or N
Do you want to retry the same edit?
Enter Y or N
Do you want to retry the same edit?
Enter Y or N
Do you want to retry the same edit?
Enter Y or N
Do you want to retry the same edit? N
crontab: edits left in /tmp/crontab.XXXX6P2m6c
沒注意crontab的時間格式寫錯了,蒙了一會怎麼回事呢?。。。
 
我給寫成這樣了:
*/10 * * * /home/shell/check_err.sh >>/var/log/crontab_root.log
正確是
101表示
第2列表示小時1~23(0表示0點),這點容易出錯。
第3列表示日期1~31
第4列表示月份1~12
第5列標識號星期0~6(0表示星期天)
第6列要執行的命令或指令碼內容


要注意細節呀,時間一長不經常使用也容易出錯的。