APLawrence.com -  Resources for Unix and Linux Systems, Bloggers and the self-employed

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.





(OLDER)    <- More Stuff -> (NEWER)    (NEWEST)   

Printer Friendly Version

-> -> Cron job doesn't run



Increase ad revenue 50-250% with Ezoic


More Articles by

Find me on Google+

© Tony Lawrence



Kerio Samepage


Have you tried Searching this site?

Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more.

Contact us