Magento Cron not working: no heartbeat task

cronmagento

I noticed the cron jobs not working because some tasks were not performed (automatic feed generation, google sitemap, …).

1) I installed the (very useful) AOE scheduler

2) I've checked cron_schedule SQL table via PHPmyAdmin: no task is generated, but if I press Generate schedule in AOE scheduler, a list of task is generated. All tasks remain in pending status (executed at NULL).

3) I've set (crontab -e)
0,5,10,15,20,25,30,35,40,45,50,55 * * * * /home/fpl/webapps/magento/cron.sh

I've tried to run cron.sh manually via SSH. When I run manually the sh the heartbeat task is run. So I'm also sure the problem is not in the cron.sh script.

Cron is properly running on the server.

Configuration

Webfaction hosting
Magento ver. 1.8.0.0

Cron schedule Configuration on magento admin panel
Generate Schedules Every 1
Schedule Ahead for 20
Missed if Not Run Within 15
Heartbeat task schedule (cron syntax) 0,5,10,15,20,25,30,35,40,45,50,55 * * * *

Thanks for your help!

Best Solution

my guess is that your cron.sh is not executable and that's why nothing is happening. Please check the file persmission and add the executable flag

chmod +x /home/fpl/webapps/magento/cron.sh

You might also want to check your server's log files for cron (e.g. https://askubuntu.com/questions/56683/where-is-the-cron-crontab-log)

Instead of relying on the fact that cron is executable you could also run it like this

/bin/bash /home/fpl/webapps/magento/cron.sh

And: instead of writing down the minutes like that you should be using this:

*/5 * * * * /bin/bash /home/fpl/webapps/magento/cron.sh

Related Question