Crontab投掷错误

时间:2017-02-20 08:51:31

标签: linux ubuntu cron crontab

我在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)

1 个答案:

答案 0 :(得分:0)

我找到了解决方案。用户名字段仅在系统级cron(etc / crontab)上可用,而不是用户级别cron。