Crontab命令不能运行

我在我的crontab上看到这个错误:

Dec 8 09:51:01 ikeyprod cron[29245]: Error: bad username; while reading /etc/crontab 

我已经validation这些命令都可以通过sudo手动推送。

 -rw-r--r-- 1 root root 2.2K 2010-12-08 09:50 crontab 

这些命令不运行,我不知道为什么…我看到上述错误,虽然…

  # /etc/crontab: system-wide crontab # Unlike any other crontab you don't have to run the `crontab' # command to install the new version when you edit this file # and files in /etc/cron.d. These files also have username fields, # that none of the other crontabs do. SHELL=/bin/sh PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin MAILTO="[email protected]" # mh dom mon dow user command 17 * * * * root cd / && run-parts --report /etc/cron.hourly 25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily ) 47 6 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly ) 52 6 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly ) # ----- IKEY ----- 5 0 * * * root bash /sites/domain.com/scripts/backup.sh 0 3 * * * root php /sites/domain.com/www/cron/clear-expired-carts.php 0 1 * * 7 root php /sites/domain.com/www/cron/generate-vehicle-sitemap.php 3 3 * * * root php /sites/domain.com/www/cron/account/update-dealer-map.php # ----- IKEY INTERNAL ----- 15 1 * * 1-5 root php /sites/internal.domain.com/www/cron/account/clock/accountability-report.php 0 6 * * 1 root php /sites/internal.domain.com/www/cron/account/clock/tardy-report.php 0 22 * * * root php /sites/internal.domain.com/www/cron/account/clock/clock-out.php # > Orders #* * * * * root php /sites/internal.domain.com/www/cron/order/generate-invoice-pdf.php # > eBay 30 1 * * * root php /sites/internal.domain.com/www/cron/ebay/get-feedback.php * * * * * root php /sites/internal.domain.com/www/cron/ebay/archive/get-listing-data.php 10 * * * * root php /sites/internal.domain.com/www/cron/ebay/archive/associate-product-with-listing.php 20 * * * * root php /sites/internal.domain.com/www/cron/ebay/archive/update-listing-status.php # > Fleetkeys * 6 * * 2 root php /sites/internal.domain.com/www/cron/fleetkeys/invoice/get-unpaid-invoices.php # > Maintenance 0 3 * * 0 mysqlcheck -Aao –auto-repair -u root -p PASSWORD > /dev/null 

您的crontab需要最后一行的用户名(mysqlcheck)。

而且:您可能想要现在更改该MySQL根密码。

问题是最后一行

 0 3 * * 0 mysqlcheck -Aao –auto-repair -u root -p password > /dev/null 

你错过了用户名