crontab格式寫錯出現報錯

2021-09-19 12:50:37 字數 2157 閱讀 7881

crontab: installing new crontab

"/tmp/crontab.***x6p2m6c":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.***x6p2m6c

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.***x6p2m6c

沒注意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列要執行的命令或指令碼內容

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

crontab: installing new crontab

"/tmp/crontab.***x6p2m6c":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.***x6p2m6c

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.***x6p2m6c

沒注意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列要執行的命令或指令碼內容

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

crontab 莫名報錯

如下crontab命令 作用即在8點30分到23點30分,每隔一小時,就ping4次www.baidu.com,並把輸出內容追加到 var ftp目錄下的,年 月 日.log檔案中。但是發現,此命令總是報錯,傳送到郵箱的報錯日誌如下 bin sh c line 0 unexpected eof wh...

Crontab 格式詳解

第1列分鐘1 59 第2列小時1 23 0表示子夜 第3列日1 31 第4列月1 12 第5列星期0 6 0表示星期天 第6列要執行的命令 下面是crontab的格式 分 時 日 月 星期 要執行的命令 這裡有crontab檔案條目的一些例子 30 21 usr local apache bin a...

crontab命令格式

crontab命令格式 m h d m d cmd 分 時 日 月 周 命令 m 分鐘 0 59 h 小時 0 23 d 天 1 31 m 月 1 12 d 一星期內的天 0 6,0為星期天 第1列表示分鐘1 59 每分鐘用 或者 1表示 第2列表示小時1 23 0表示0點 第3列表示日期1 31 ...