Server Fault is a question and answer site for system and network administrators. 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 have a hourly cronjob script that curls a php script. The php script isn't being executed. In crontab -e I have:

1 * * * * /var/www/path/to/

Doing grep cron /var/log/syslog outputs:

Mar 23 21:45:01 Emile CRON[5339]: (root) CMD (/var/www/path/to/
Mar 23 22:01:01 Emile CRON[5386]: (root) CMD (/var/www/path/to/
Mar 23 22:01:01 Emile CRON[5387]: (root) CMD (/var/www/path/to/
Mar 23 22:14:01 Emile CRON[5425]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
Mar 23 22:15:01 Emile CRON[5429]: (root) CMD (/var/www/path/to/

I've verified that the url that is being curl in is correct and that the path in crontab -e is correct. I also verified that the php script works when manually executed. What else is there? Any ideas? Another way to diagnose? What's that cd / && run-parts in my syslog?

Thanks in advance for the help!

share|improve this question
Have you checked your user's mail spool for error messages? run-parts is used to run all the scripts placed in the cron.hourly and cron.daily (and weekly and monthly) directories. – DerfK Mar 23 '11 at 22:51
When you say manually executed, do you mean "php /path/to/phpfile.php" or "curl url/to/phpfile.php";? The first confirms that the .php file is valid and executable, the second will confirm if it can be gotten to via http, and if the web server will allow it to run. – malcolmpdx Mar 23 '11 at 23:46
up vote 3 down vote accepted

What usually can happen is a $PATH problem. It's curl being used with it's full path on or just curl?

You can also change the first line of the script (if you are using bash) from #!/bin/bash to #/bin/bash -x (that will generate debug output from bash).

Anyway, as @derfK said on his comment, check the user email for errors (the script debug will also be sent to the user email). You can change the email which cron uses to send messages putting MAILTO=<email> before the rule lines.

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.