0

I have created a cron job and its only working when I run the below command:

php bin/magento cron:run

But the cron should run automatically. What Could be the issue and why the cron is not running automatically in my case?

Could anyone please help me and guide on this?

2
  • one common reason is file permissions. you can check if the cron runner has permission to execute the bin/magento and permission to write in cache/log folders. you can also check the contents of your cron job by crontab -l
    – Erfan
    Commented Jun 18, 2020 at 10:33
  • When I run crontab -l, I'm getting this #~ MAGENTO START b1e1a8c19b30d7e143962d6d256e73c57556b9b50ec8e3cd482dc9a652c715e5 * * * * * /usr/bin/php7.3 /usr/share/nginx/html/bin/magento cron:run 2>&1 | grep -v "Ran jobs by schedule" >> /usr/share/nginx/html/var/log/magento.cron.log * * * * * /usr/bin/php7.3 /usr/share/nginx/html/update/cron.php >> /usr/share/nginx/html/var/log/update.cron.log * * * * * /usr/bin/php7.3 /usr/share/nginx/html/bin/magento setup:cron:run >> /usr/share/nginx/html/var/log/setup.cron.log #~ MAGENTO END b1e1a8c19b30d7e143962d6d256e73c57556b9b50ec8e3cd482dc9a652c715e5
    – MagentoDev
    Commented Jun 18, 2020 at 10:38

1 Answer 1

0

There is simple solution for this.

First check cron installed or not using crontab -e

Make sure the below line is present in it:

If this is not present, kindly run below command:

php bin/magento cron:install

Then you are good to go. Cron jobs will schedule by its own...

Thanks

Your Answer

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

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