tibberous Posted January 12, 2011 Share Posted January 12, 2011 I have a cron script that is just supposed to send me an email every hour. I added this line to /etc/crontab 01 * * * * root run-parts php /daemons/hourly.php Then I reset cron. If I run the command: php /daemons/hourly.php in putty, I get the email. Any idea why the cron isn't sending it? Quote Link to comment https://forums.phpfreaks.com/topic/224175-any-idea-what-is-wrong-with-my-cron/ Share on other sites More sharing options...
JonnoTheDev Posted January 12, 2011 Share Posted January 12, 2011 It is possible that the location of php isn't available. Try adding the path to php in the cron line i.e. 01 * * * * root run-parts /usr/local/bin/php /daemons/hourly.php Quote Link to comment https://forums.phpfreaks.com/topic/224175-any-idea-what-is-wrong-with-my-cron/#findComment-1158351 Share on other sites More sharing options...
xylex Posted January 12, 2011 Share Posted January 12, 2011 01 * * * * root run-parts php /daemons/hourly.php run-parts is for running files in a directory, not for a specific file. And do you need to run it as root? If not - 01 * * * * php /daemons/hourly.php Quote Link to comment https://forums.phpfreaks.com/topic/224175-any-idea-what-is-wrong-with-my-cron/#findComment-1158357 Share on other sites More sharing options...
tibberous Posted January 14, 2011 Author Share Posted January 14, 2011 Good thinking neil, but xylex got it right! Good job xylex! Quote Link to comment https://forums.phpfreaks.com/topic/224175-any-idea-what-is-wrong-with-my-cron/#findComment-1159181 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.