Can anyone provide insight to why my cron jobs are not running? I has tried simple jobs, like a date/time job, and it works.

Below is an example of what I am trying to run:

# Begin Whenever generated tasks for: taxscribe
0 0,6,12,18 * * * /bin/bash -l -c 'cd /home/deploy/taxscribe/releases/20110311205859 && RAILS_ENV=production rake informer:sync:submitted --silent'

0 * * * * /bin/bash -l -c 'cd /home/deploy/taxscribe/releases/20110311205859 && RAILS_ENV=production rake informer:sync:extensions --silent'

0 * * * * /bin/bash -l -c 'cd /home/deploy/taxscribe/releases/20110311205859 && RAILS_ENV=production rake informer:sync:accounts --silent'

# End Whenever generated tasks for: taxscribe

Thanks for your help.

migrated from stackoverflow.com Mar 21 '11 at 18:45

This question came from our site for professional and enthusiast programmers.

  • Is this in the per-user crontab or in the system-wide crontab? If it's the latter, then it needs a user field` before the command. – Joachim Sauer Mar 21 '11 at 16:11
  • it is in the per-user under our deploy user – Queencity13 Mar 21 '11 at 16:22
  • 1
    Why are you running these in a subshell? They are already going to run in a subshell. This might be part of the problem. Remove the /bin/bash -l -c ' and the matching end quote, and add `SHELL=/bin/bash' to the top of the crontab. – JeffG Mar 21 '11 at 19:16

maybe rake isn't in the PATH when crond attempts to execute the job? (try putting the full path to the rake binary)

  • when I run each job manually they run fine. – Queencity13 Mar 23 '11 at 13:14
  • yep but when run from crond, the PATH might be different. Simply replace "rake" with "/full/path/to/rake" and see if it works. – ggiroux Mar 23 '11 at 14:21
  • Thanks ggiroux...it looks like putting the full path in the job makes it work. – Queencity13 Mar 24 '11 at 18:08

Ensure that crond is running

pgrep crond
  • crond is running b/c it provides me with the pid number – Queencity13 Mar 21 '11 at 19:13
  • The cron daemon is not called crond on all systems. On my gentoo box it's just cron. pgrep cron would match both variants. – MattBianco Mar 22 '11 at 9:20

Check to see if crond is running and also check to see that it is set to startup with the system

chkconfig crond --list

if it isn't then do

chkconfig crond on

to have have it start at boot.

Also check your logs. Ensure that there isn't an error in your scripts preventing execution.


  • I dont have a cron log – Queencity13 Mar 23 '11 at 13:10

If the jobs that you are running produce any output then cron will have mailed that to the account that was running the job.

You could capture the output of the jobs to a log file e.g.

/bin/bash -l -c 'cd /home/deploy/taxscribe/releases/20110311205859 && RAILS_ENV=production rake informer:sync:submitted --silent &>/path/to/file.log'

and see what it has to say.

  • when i try to add the log file to the end of the job, i get permission denied when run them manually...I assume it has to do with being signed in as a deploy user – Queencity13 Mar 23 '11 at 13:12
  • @Queencity13: change the /path/to/file.log to something that you can write to. – Iain Mar 23 '11 at 13:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.