1

Why we simply cannot get the CRON to run on Magento2 (2.2).

The Crontab is below. The Cron_Schedule database table only ever populates if we trigger the Magento Cron manually from the CL.

* * * * * /RunCloud/Packages/php70rc/bin/php /home/runcloud/webapps/magento cron:run | grep -v "Ran jobs by schedule" >> /home/runcloud/webapps/magento/var/log/magento.cron.log

* * * * * /RunCloud/Packages/php70rc/bin/php /RunCloud/Packages/php70rc/bin/php /home/runcloud/webapps/magento/update/cron.php  >> /home/runcloud/webapps/magento/var/log/update.cron.log

* * * * * /RunCloud/Packages/php70rc/bin/php /RunCloud/Packages/php70rc/bin/php /home/runcloud/webapps/magento setup:cron:run >> /home/runcloud/webapps/magento/var/log/setup.cron.log

* * * * * echo asdf > /home/runcloud/webapps/magento/var/log/test.cron.log
  • If we run the cron manually via CL it runs fine so sure it's not a user or file permissions problem.
  • The binary path is set exactly as per 'which PHP' output
  • The bottom line in the crontab is a test I created which works fine so I know the absolute paths to Magento install are correct.
5
  • 1
    When does it not work? You say it runs when you trigger it from the cli. So when does it not work? Feb 6, 2018 at 14:00
  • have you checked the log files for any exception? check also exception.log besides the normal cron related log files. oh i had problems with cron because of some orphan jobs in the core_config_table but it should not happen to you if it's a fresh install
    – sissy
    Feb 6, 2018 at 14:04
  • @Vulpea - It doesn't work automatically - i.e once every minute as per the Cron settings. But I can go to the Magento CLI and call cron:run and it will run fine.
    – JcG
    Feb 6, 2018 at 15:23
  • @sissy - I can't see anything related in the exception.log, Can you elaborate on the orphan job issue?
    – JcG
    Feb 6, 2018 at 15:23
  • I cannot find the right question/answer at the moment. I will update this as soon as i have some minutes free. by now you can also have a look at this magento.stackexchange.com/questions/107631/…
    – sissy
    Feb 7, 2018 at 7:45

1 Answer 1

1

This turned out to just be an error with the PHP paths. We thought the full path was required as suggested by the RunCloud CRON task builder, but instead it worked with just bin/php for the PHP binary path.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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