Magento 1.9.1 Cron not working

I have big problems with cron Magento 1.9.1, hoping someone can help. I have AOE installed and my heartbeat is not visible.

I added my cron job

*/5 * * * * /bin/sh /var/sites/p/domain/public_html/cron.sh 

But it still does not work, so I decided to try and run cron.php, it does nothing. This is my cron for this

 */5 * * * */usr/bin/wget -O /dev/null -o /dev/null http://www.domain.com/cron.php 

Based on Magneto 1.8 cron.php, I added the following to cron.php.

 $isShellDisabled = true; 

Based on this, it still does not work, I tried cron.php in the browser. I get an error in the browser that is disabled by default for printing for security reasons.

So, I changed my php.ini to memory_limit = 512M just by unlocking. This still does not work.

The error I get in my reports for this is:

  a:5:{i:0;s:59:"Mage registry key "_singleton/cron/observer" already exists";i:1;s:537:"#0 /var/sites/p/domain.co.uk/public_html/app/Mage.php(223): Mage::throwException('Mage registry k...') #1 /var/sites/p/domain.co.uk/public_html/app/Mage.php(477): Mage::register('_singleton/cron...', false) #2 /var/sites/p/domain.co.uk/public_html/app/code/core/Mage/Core/Model/App.php(1316): Mage::getSingleton('cron/observer') #3 /var/sites/p/domain.co.uk/public_html/app/Mage.php(448): Mage_Core_Model_App->dispatchEvent('default', Array) #4 /var/sites/p/domain.co.uk/public_html/cron.php(74): Mage::dispatchEvent('default') #5 {main}";s:3:"url";s:9:"/cron.php";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:5:"admin";} 

Any help would be really great.

Note ** I changed the domain name to DOMAIN due to the fact that my site is not suitable for work.

+6
source share
3 answers

A few simple steps to fix Magento cron problem:

  • Go to System> Configuration> Advanced> System> Cron (Scheduled Tasks) and set the following values:

    • Generate schedules each: 15
    • Ahead Schedule for: 20
    • Missed if not working inside: 15
    • Clear History Each: 10
    • Success Story Life Span: 60
    • Bounce History Life Span: 600
  • Clear Cache on System> Cache Management

  • Clear the cron_schedule table. You can do this via phpmyadmin or run the following command in the SQL console:

    TRUNCATE TABLE cron_schedule;

  • Add the following line to the cron settings (use absolute paths):

    * / 5 * * * * / usr / bin / php / var / sites / p / domain / public_html / cron.php

  • Restart cron daemon.

  • Check the cron_schedule table if it is not empty - Magento cron script will start working.

+14
source

Ok, I had another problem. My cron just didn't work, although cron.php was executed correctly. There is still no way out, and no tasks.

I checked cron_schedule and noticed that the last work since March 19 of this year (sic!). Therefore, I continued to search for the cause.

Finally, I noticed that there is a process (sic!) With my crown of March 19th.

josh 21350 99.6 0.4 350400 133492 ? R Mar19 241812:21 /usr/bin/php /var/www/mysite/cron.php -mdefault

I killed the job with kill -9 21350

And voila! A newsletter is suddenly sent out!

I had no idea why and how this happened. Now I know that I should pay attention to this, therefore I will.

+5
source

I just saw that you are using magento 1.9.1.

Run cron using php instead: / usr / local / bin / php -f / home / cpanel_username / public_html / cron.php

This should resolve the http permissions issues that may occur when using 'usr / bin / wget -O / dev / null -o / dev / null'

Try this command and let me know if it works for you.

+1
source

Source: https://habr.com/ru/post/985518/


All Articles