添加crontab的时候报错Do you want to retry the same edit?

avatar 2021年4月11日18:11:11 评论 6,288 次浏览

今天加定时任务的时候,发现保存不了,保存的时候总是提示Do you want to retry the same edit?,后来看了一下原来着急把定时任务写错了,可以参考:https://www.wulaoer.org/?p=763

[root@www.wulaoer.org ~]# crontab -e
no crontab for root - using an empty one
crontab: installing new crontab
"/tmp/crontab.yZz96P":1: 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? Y
crontab: installing new crontab

后来修改了一下任务,保存成功,还有一个需要注意的是,定时任务加上去了,但是脚本不定时执行,主要是在加定时任务的时候,直接使用的脚本,需要在脚本前加个bash即可。

avatar

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: