crontab运行日志信息如下:
Dec 24 19:16:46 iZ0jlgj4m8fss6uicaqh7wZ crond[14392]: (CRON) INFO (Syslog will be used instead of sendmail.)
Dec 24 19:16:46 iZ0jlgj4m8fss6uicaqh7wZ crond[14392]: (CRON) INFO (RANDOM_DELAY will be scaled with factor 0% if used.)
Dec 24 19:16:46 iZ0jlgj4m8fss6uicaqh7wZ crond[14392]: (CRON) INFO (running with inotify support)
Dec 24 19:16:46 iZ0jlgj4m8fss6uicaqh7wZ crond[14392]: (CRON) INFO (@reboot jobs will be run at computer's startup.)
修改配置后需要重新加载
/sbin/service crond reload
其他命令
/sbin/service crond start //启动服务 /sbin/service crond stop //关闭服务 /sbin/service crond restart //重启服务 /sbin/service crond reload //重新载入配置 /sbin/service crond status //查看状态
或使用
service crond start service crond stop service crond restart service crond reload service crond status
错误信息如下
(CRON) DEATH (can't lock /var/run/crond.pid, otherpid may be 32082): Resource temporarily unavailable
直接kill -9 [pid] 把现有的crond进程干掉,然后 sudo service crond restart
如果还是无法解决,输入命令查看cron日志:
补充:
如果不行,只能卸载,再安装
yum remove crontabs yum install crontabs
补充 2018-01-08:
Amazon Linux 2023 系统需要安装时候需要安装下面命令
yum install cronie