0

I'm experiencing a weird cron issue in Magento ver. 1.13.0.2. The cron_schedule table only contains one row:

  1 | enterprise_refresh_index | success | NULL     | 2015-08-13 22:37:00 | 2015-08-13 22:37:00 | 2015-08-17 19:29:01 | 2015-08-17 19:29:01

But I'm missing all the others crontabs from Magento core and custom extensions. I setup crontab and I have also tried to run cron.php manually. If I do run it manually the "executed_at" and "finished_at" time will be updated.

If I look into core_config_data table and search for "cron" I only see 2 cron related data sets:

mysql> select * from core_config_data where value like "%cron%";
+-----------+---------+----------+------------------------------------------------+------------------------------------------------+
| config_id | scope   | scope_id | path                                           | value                                          |
+-----------+---------+----------+------------------------------------------------+------------------------------------------------+
|       131 | default |        0 | catalog/productalert_cron/error_email_template | catalog_productalert_cron_error_email_template |
|       937 | default |        0 | crontab/jobs/log_clean/run/model               | log/cron::logClean                             |
+-----------+---------+----------+------------------------------------------------+------------------------------------------------+
2 rows in set (0.00 sec)

mysql> 

The module code/core/Mage/Cron is enabled. Further logging is enabled but I don't see any cron related issues in system.log nor in exception.log. Also server logs are empty.

Has anyone an idea what could cause the issue or how to debug it? Thanks!

1

If by "running it manually" you mean that you went to cron.php in your browser and still have nothing in the table, then the script is probably exiting very early. Try opening cron.php and forcing the $isShellDisabled variable to true. (I don't have the code open in front of me.)

  • Wow, this worked. Now I have to investigate why this fixed the issue. Thank you so much for your help! – Stefan Aug 18 '15 at 15:25
  • Happy to help. This probably has something to do with the settings in your php.ini As a side note, make sure when you setup the crontab that you point it to cron.sh (not cron.php) and that the crontab runs as the same user that PHP is running as. – Tyler V. Aug 18 '15 at 15:47
0

Your cron probably isn't actually set up on the server. You have to create a cronjob from SSH or your control panel to call cron.sh in your site root (usually on 5-minute intervals). That is what actually runs the tasks on an ongoing basis. If nothing is calling cron.sh or cron.php on an ongoing basis, then nothing will actually happen (as you've noticed).

For an explanation of creating the cronjob from SSH, see williem wigman's answer here: https://magento.stackexchange.com/a/32580/1905

If you use a hosting control panel instead of SSH to create it, the process entirely depends on how your particular control panel works. In general, you want it to run on a 5-minute interval (*/5 * * * *), and you want it to execute sh {your_path_to_magento}/cron.sh.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.