Magento – Cron jobs are not executing

cronmagento-1.9

In my website till the last week crons was working fine and suddenly stopped working and even stopped scheduling in the cron_schedule table. so i had truncated cron_schedule and executed php cron.php file through ssh and jobs has been scheduled but this jobs are not executing and status of this jobs are still pending.

Please Help me in debbuging this issue.

Best Answer

It sounds like you have two issues.

  1. Cron jobs are no longer scheduled in the cron_schedule table; and
  2. Cron jobs are no longer executing.

For #1, you should check whether someone changed the server configuration that called cron.sh. You want to ensure that some crontab on your system lists a command like this.

*/5 * * * * sh /path/to/your/magento/site/root/cron.sh

You can commonly find cron jobs by running commands like this. Note that you'll need sudo permissions.

echo Display system-wide crontab
sudo cat /etc/crontab

echo Display crontabs for all users on system
for user in $(cut -f1 -d: /etc/passwd); do echo $user; sudo crontab -u $user -l; done

More details available in this post.

How to configure Magento cron job

https://blog.amasty.com/configure-magento-cron-job/