Cron job doesn't run
Got questions? Go ahead: Ask me anything!
A customer writes:
"We want to use the default cron set up with our Red Hat (/etc/cron.hourly, /etc/cron.daily). We have placed files in these directories and they work great. According to the Red Hat Sys Adm guide, we should be able to put files in the /etc/cron.d directory when we want to run them at times other than hourly, daily, weekly. I placed a test file in the /etc/cron.d dir that has the same format as cron. This file is set to run every 5 minutes. It does not run."
The clue there is the "has the same format as cron". Files put in cron.d have a similar format to normal cron jobs, but need one extra parameter. A "normal" crontab file might look like:
*/5 * * * * /usr/local/bin/myjob
but if it is to be put in cron.d it needs a user name before the actual command:
*/5 * * * * root /usr/local/bin/myjob
See Cron is not working also.
Got something to add? Send me email.
Increase ad revenue 50-250% with Ezoic
More Articles by Tony Lawrence
Find me on Google+
© 2011-03-18 Tony Lawrence