Cron Job not running

software development

#1

I set up a cron job to run every hour and email me the results. It emailed me a couple of results a few days ago, but it hasn’t emailed me since. Not in my Spam folder. Any insights? I sent a question to their support line 12 hours ago but haven’t had response yet.


#2

OK I got a response from Dreamhost telling me I need to add the PHP path to the command. I was able to connect to the file that needs to be run, but I changed some things in the script and now nothing… Its predictable that errors will occur as part of the development process, but how can I tell if the script was even run and get some error reporting?

Thanks E


#3

run it manually to verify that it works
full paths can be found with [font=Courier]which php[/font]
don’t rely on cron to mail you. add it to the script using PHP’s mail functions or writing a bash script so that you can use mutt or other mail program
you can also add a few lines to write the output to disk to see if the problem is in not receiving mail or job not running.


#4

That’s a good idea to add error catching in the script. Thanks!