Magento – How to check Cronjob is working and make it work

cron

I setup cronjob on server's crontab

*/5 * * * * /home/users/mydomain/www/cron.php >> /home/users/mydomain/www/var/log/cron.log 2>&1

30 3 * * * php /home/users/mydomain/www/shell/indexer.php --reindex catalog_url

it seems working on server

[root@ /var/log]# grep '/home/users/mydomain/www/cron.php' cron

May 10 16:00:01 crond[21592]: (root) CMD (/home/users/mydomain/www/cron.php >> /home/users/mydomain/www/var/log/cron.log 2>&1)
May 10 16:05:01 crond[21718]: (root) CMD (/home/users/mydomain/www/cron.php >> /home/users/mydomain/www/var/log/cron.log 2>&1)
May 10 16:10:01 crond[21766]: (root) CMD (/home/users/mydomain/www/cron.php >> /home/users/mydomain/www/var/log/cron.log 2>&1)

but when I check the cron scheduler module I can see that cronjob is not working

Last heartbeat is older than one hour. Please check your settings and
your configuration!

Both cronjob and scheduler works well before I moved my all files to other folders

How can I check Cronjob is working and make it work?

Best Answer

Take a view to your MySQL Database > table cron_schedule. There are all magento created jobs with timestamp of creation, scheduled, executed and their status.

If anything wrong, then look for the cron job in the table and see if there is any log in the messages column.

Related Topic