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
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: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.