解决“/tmp/crontab bad minute”问题

转载于  https://blog.csdn.net/zwj695535100/article/details/50770996

crontab在linux中用处很大,但是初次使用会出各种错误,其中一种错误就是

"/tmp/crontab.sdXvj4":5: bad minute

errors in crontab file, can't install.

Do you want to retry the same edit? 

”,而通过该文章就可以解决

1 很简单,因为你的crontab格式错误,即没有按照规则写。修改完显示“crontab: installing new crontab”表示成功。

如果知道了自己的错误就到此结束。如果不知道自己错哪了,可以看下面列举的例子。

2 crontab 的语句是“分 时 日 月 周 命令”(之间有空格,如果多个月份,用逗号隔开,两个月份间的用“-”隔开),如果只限定分,时,其余的三个选项要用*(星号)补全哦。

如*/2 * * * * date >> /home/rw/time.log  每隔2分钟 把Ubuntu系统时间写入time.log

查看有没有其他错误,比如少了一个*(星号),或者多了一个时间等。

当出现“crontab: installing new crontab”时表示修改成功。

我的原因是因为空格的原因

原文地址:https://www.cnblogs.com/Hello-TomCat/p/13913398.html