[BlueOnyx:11776] Cron issues

Jim Matysek matysekj at usms.org
Mon Dec 10 15:33:23 -05 2012


Over the weekend a co-worker wanted to add a new script to be run as a 
cron job. He forgot how to do this and ran crontab -e from the command 
prompt several times before figuring it out. He said that several times 
a blank editor came up and at least once the content of the existing 
/etc/crontab file came up. Anyway, he ultimately figured out to edit the 
/etc/crontab file and then ran /etc/init.d/crond restart and his cron 
job started running. The problem is that ever since that time, I (as the 
server admin) get an email EVERY time any cron job runs with the 
following message:

/etc/bash: root: command not found

This happens for all cron jobs - those run through /etc/cron.daily, 
cron.hourly, etc. as well as any custom ones we've added to /etc/crontab 
without runparts. Now we have two different ones that run every 10 
minutes, so I'm getting a boatload of emails that are driving me nuts. 
The actual script specified in the crontab file runs just fine, but I 
get this email anyway. My guess is that somehow a config file somewhere 
for cron got modified such that a crontab line like:

30 23 * * * root /home/sites/www.mysite.com/cron/mycronjob.sh

is now being interpreted as two commands to run: first to run the 
command "root" and then to run the other command. It seems that somehow 
the config has changed to not read the "root" entry as "run this script 
as root", but rather a job to run.

Any suggestions for where to look?

We already ran a find from the root directory looking for crontab and 
didn't find any new crontab files set up anywhere on the server, just 
the one at /etc/crontab (thought maybe a new one was set up with a bad 
spec in it). I looked at /etc/init.d/crond and it was last changed on 
February 22, so that didn't get changed.  I also re-booted the VPS last 
night, hoping that cron would come up fresh from the boot fixed, but no 
luck there either.

-- 
Jim Matysek
http://usms.org | FB: http://facebook.com/USMastersSwimmingFanPage




More information about the Blueonyx mailing list