1

Starting from the official documentation: https://devdocs.magento.com/guides/v2.2/config-guide/cli/config-cli-subcommands-cron.html#create-the-magento-crontab

Somewhere in there is this... that gets added to crontab

#~ MAGENTO START
* * * * * /usr/bin/php /var/www/html/magento2/bin/magento cron:run | grep -v Ran jobs by schedule >> /var/www/html/magento2/var/log/magento.cron.log
* * * * * /usr/bin/php /var/www/html/magento2/update/cron.php >> /var/www/html/magento2/var/log/update.cron.log
* * * * * /usr/bin/php /var/www/html/magento2/bin/magento setup:cron:run >> /var/www/html/magento2/var/log/setup.cron.log
#~ MAGENTO END

There are 3 things that get executed every minute.
What's the difference between cron:run, cron.php and setup:cron:run ?

4
  • Possible duplicate of Difference between cron:run and setup:cron:run
    – MagenX
    Commented Feb 27, 2019 at 10:48
  • @MagenX, Marius have the query about magento2/update/cron.php
    – Amit Bera
    Commented Feb 27, 2019 at 10:54
  • @MagenX the question is not a duplicate. The one you mention asks for difference between 2 lines. Mine has something extra.
    – Marius
    Commented Feb 27, 2019 at 10:55
  • With Magent 2.4 it is only a single line, not three. See Configure and run cron
    – robsch
    Commented Jan 8, 2021 at 10:25

1 Answer 1

1

magento requires to run 1 + 2,3 cron tasks:

1 - cron:run = indexer and scheduled tasks

2 - setup:cron:run = Web Setup Wizard + Component Manager

3 - update/cron.php = System Upgrade

3
  • i guess creating so many cronjobs was overlooked by magento engineers...
    – MagenX
    Commented Feb 27, 2019 at 11:16
  • What If I don't use the setup wizard and I don't need to run system upgrades on a regular basis? Can I just use cron:run.
    – Marius
    Commented Feb 27, 2019 at 11:38
  • sure you can run any cronjobs you need
    – MagenX
    Commented Feb 27, 2019 at 15:00

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.