Magento Introduction - What is Magento Cron Job?

What is Magento Cron Job?

Cron is a time-based job scheduler in Unix-like computer operating systems. Cron enables users to schedule jobs (commands or shell scripts) to run periodically at certain times or dates. It is commonly used to automate system maintenance or administration

Why do we need a cronjob in Magento?

Because some tasks need to be automated - you don't really want to refresh the catalog index in Magento every couple of minutes, do you? A few features in Magento require a script to be run periodically. These features include, but are not limited to:

- Catalog Price rules
- Sending Newsletters
- Generating Google Sitemaps
- Customer Alerts/Notifications (product price change, product back to stock)
- Automatic updating of currency rates
- Scheduled DB logs cleanup

Magento uses the cron.php file sitting inside the root directory of Magento to manage and dispatch cronjobs. The cron.php script basically executes the internal Magento cronjob manager, managing which and when cronjobs are executed.

magento 2 tutorial

Other Answers in the Category "Magento Introduction"