Hi, I'm trying to set up a cron job to run a PHP script hourly. This is my crontab entry:
What am I doing wrong? I have also tried in the format:
and still no luck. Can anyone help? asked 19 Oct '11, 14:08 appltn |
You need to specify the PHP interpreter, like this: 0 /1 * * /usr/local/bin/php $HOME/webapps/path/to/cron/cron.php I hope this helps! answered 19 Oct '11, 15:54 maryh Hi thanks for the response, but it still isn't working. This is what I have now:
(running once a minute whilst I'm debugging) Have I got the syntax for the timing correct? Is it okay to use $HOME? Could there be something else wrong?
(23 Oct '11, 04:20)
appltn
Yes, the syntax and the $HOME both are ok. Yes, something else could be wrong. Can you execute the command without problems on the terminal? If so, can you file a ticket at help.webfaction.com so we can look further?
(23 Oct '11, 04:43)
neeravk
Aha! It didn't occur to me that I could run it from the command line, but once I did the error messages let me track down the issue - my cron.php script was referencing a relative path which couldn't be found. Changed to an absolute path and it works. Thanks for the help!
(23 Oct '11, 05:19)
appltn
|