4

I've tried many solutions, but can not seem to get cron restored. It was working fine and suddenly it no longer does. I have Truncated the cron_schedule table, but it doesn't populate. If I run cron.php (Had to remove the block from .htaccess) it will populate the cron_schedule table, however the cron I used that previously worked, no longer works.

sh /home/vigeos/public_html/cron.sh 

I have tried

/home/vigeos/public_html/cron.sh /home/vigeos/public_html/cron.php -mdefault
/home/vigeos/public_html/cron.sh /home/vigeos/public_html/cron.php -malways

and

/bin/sh /home/vigeos/public_html/cron.sh

I even ran which php and changed cron.sh to be

PHP_BIN=`/usr/local/bin/php`

Still no results.

I also tried to change permissions of cron.sh and cron.php to be 744 which also did not work. I'm running out of ideas here. I even restarted cron daemon in between.

Any suggestions?

3 Answers 3

0

I realize this is an old post, but did you ever get this resolved? I have run into some cron issues recently and, as far as I can tell, the cron.sh file got corrupted at some point in the 1.9 releases. There are tabs where there should be spaces and missing spaces around one of the ;. Bash scripts are VERY picky about spacing, so even if it looks right, 1 tab does NOT equal 3 spaces in Bash world. I fixed that and everything started working again.

3
  • This does not really answer the question. If you have a different question, you can ask it by clicking Ask Question. You can also add a bounty to draw more attention to this question. - From Review
    – Jarnail S
    May 15, 2019 at 0:28
  • Sure it does! If your issue is a corrupt file, you can solve it by fixing that. Feel free to alter it or make it a comment instead, but I contest it does address the OP.
    – Mageician
    May 17, 2019 at 20:47
  • Sorry for delayed response. Yes, I figured it out. I will post my solution.
    – vigeos.net
    Jun 24, 2019 at 3:18
0
/usr/local/bin/php /home/vigeos/public_html/cron.php -mdefault
/usr/local/bin/php /home/vigeos/public_html/cron.php -malways

This is how I solved the problem

0

I am running Magento 1.9.3.4 and had problems to get cron jobs running after moving to a new shared hosting provider. Nothing seemed to solve the problem. I figured out two things. Magento somehow preveted the cron job from running and it was using the default client version of php. In my case php 7.2, while Magento was using php 5.4.

In the end I made 2 changes as follows before setting up the Cron Jobs:

  1. Edit the .htaccess file in the magento root directory as follows:
    • Search for <Files cron.php>
    • Comment is out as follows - #<Files cron.php>
  2. Edit the cron.sh file as follows:
    • Search for PHP_BIN=which php , copy it to a new line right below it
    • Comment out the original line as follows - #PHP_BIN=which php
    • On the 2nd line (the copied one), replace which php with the path to where your version of php is called from (in my case it was /opt/php54/bin/php but it is normally /usr/php/54/bin/php). Find out from your hosting provider what this path is. Please note that you must first establish which version of php your Magento installation uses.

After this go to you CPanel Cron Jobs and set-up your cron job as follows: Schedule setting e.g. once every 15 minutes

/bin/sh /full path to your site root directory/magento install directory/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.