【发布时间】:2017-02-20 17:17:21
【问题描述】:
我在crontab中有如下内容:
20 1,7,13,18 * * * /usr/sbin/automysqlbackup
15 * * * * root find /opt/activeMq/activemq-data/localhost/KahaDB/ -mtime +10 -type f -delete
但是当我重新启动 cron 服务时我得到了这个:
Feb 20 08:43:27 . crontab[14584]: (root) BEGIN EDIT (root)
Feb 20 08:44:08 . crontab[14584]: (root) REPLACE (root)
Feb 20 08:44:08 . crontab[14584]: (root) END EDIT (root)
Feb 20 08:44:28 . kernel: [325740.483115] init: cron main process (14563) killed by TERM signal
Feb 20 08:44:28 . cron[14641]: (CRON) INFO (pidfile fd = 3)
Feb 20 08:44:28 . cron[14642]: (CRON) STARTUP (fork ok)
Feb 20 08:44:28 . cron[14642]: Error: bad username; while reading /etc/crontab
Feb 20 08:44:28 . cron[14642]: (*system*) ERROR (Syntax error, this crontab file will be ignored)
Feb 20 08:44:28 . cron[14642]: (CRON) INFO (Skipping @reboot jobs -- not system startup)
【问题讨论】:
-
第一行没有
root作为第六个字段。那样行吗?尝试替换为20 1,7,13,18 * * * root /usr/sbin/automysqlbackup。 -
我做了,但遇到了同样的问题