1

I have verified that my php script runs from the command line, but it has not been executed from the crontab (yet, I guess). Does it take a while for it to start working?

this is the crontab line:

00,15,30,45 * * * * php /var/www/download.php

I want it to execute everyday, every fifteen minutes starting at the top of the hour.

2 Answers 2

2

Most likely it is environment variable issue. First thing to check is whether cron user has php in its path?

Cron jobs don't have access to all the env variables set in user's profile. Better to redirect stdout and stderr to a file in your cron command like this:

*/15 * * * * php /var/www/download.php > $HOME/cron.out 2>&1

And then after 15 minutes examine $HOME/cron.out why it failed.

Sign up to request clarification or add additional context in comments.

1 Comment

I have no idea why it failed. I added the */15 to the crontab but before I could save it the cron job ran.
1
*/15 * * * * php /var/www/download.php

if that fails, then your script is probably failing. permissions and what not. check the cron log.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.