Adding file to /etc/cron.d doesn't make it run (ubuntu 10.04)

Posted by tom on Server Fault See other posts from Server Fault or by tom
Published on 2012-09-07T09:29:46Z Indexed on 2012/09/07 9:39 UTC
Read the original article Hit count: 201

Filed under:
|

If I scp a cron file into /etc/cron.d it doesn't run unless I edit the file and change the command. Then crond seems to pick up the cron file.

How can I make cron reload its cron files in ubuntu 10.04? 'touch'ing the file doesn't work nor does 'restart cron' or 'reload cron'.

My cron file is set to run every minute and logs to a file. Nothing ends up in the log file until I edit the command, and there's no entry for it in /var/log/syslog

I'm stumped.

Here's my cron file saved to /etc/cron.d/runscript

# Runs the script every minute. This is safe because it will exit with success if it's already running
* * * * * www-data if [ -f /usr/local/bin/thing ]; then exec /usr/bin/php /usr/local/bin/thing mode:prod -a 14 -d >> /var/log/thing/mything.log 2>&1; else echo `date +'[%D %T]'` "Thing not deployed. Command not run\n" >> /var/log/thing/mything.log; fi &

© Server Fault or respective owner

Related posts about ubuntu

Related posts about cron