Magento 2.3: Cron job is only working when I run the cron command manually

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?

1

1 Answer

Cronjobs in Magento are separate from the cronjobs ran on the server. A cronjob in Magento can't run without a cronjob on the server.

If you want cronjobs in Magento to run automatically you'll have to add a cronjob on the server.

* * * * * bin/magento cron:run

I do not recommend copy-pasting the above as a cronjob on your server, it does for example not log any output.

If you want a more detailed explanation about the workings of cronjobs in Magento I recommend the article in Magento DevDocs below.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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.

You Might Also Like