Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to run a script on a daily basis, and figured that I'd use the same setup that the other cron jobs are configured on this server - by placing the script in the /etc/cron.daily folder.

However, the script was not run overnight - although others in the daily folder were (logs were rotated, etc). The script is owned by root (as are the original ones in there), and the permissions are set to 755 (as are the original ones in there) - and the script runs when called manually.

I have found this related question Cron.hourly won't run but don't find the answers anywhere near satisfactory - sudo crontab -l tells me there is no crontab for root (although, I know I can created one), and it would make more sense to use the same method as the preinstalled jobs anyway rather than split cron configuration.

Anyone able to point at something I might have missed?

For the record - the script filename is drupal

share|improve this question
up vote 4 down vote accepted

Managed to work out how to do a bit of debugging by using run-parts -v /etc/cron.daily - and after a disabled the apt script (with its random upto 30 minute sleep) I found the error message for the new script:

run-parts: failed to exec /etc/cron.daily/drupal: Exec format error
run-parts: /etc/cron.daily/drupal exited with return code 1

This didn't turn up in the syslog though - which would have been helpful.

That's when I realised that I hadn't but a #!/bin/sh directive at the top of the script - fixed that, ran the run-parts command again, and all sorted.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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