Site icon MageComp Blog

How to Set Up Cron Jobs in Magento 2

How to Set Up Cron Jobs in Magento 2

How to Set Up Cron Jobs in Magento 2

Cron jobs in Magento used generally to serve the purpose of automating system administration and maintenance. It helps users to schedule jobs to run periodically based on date and time we have setup. Alike earlier Magento 1.x versions, Magento 2 requires the cron job setup to periodically run and operate some of the features like sending newsletters, creating Google, auto updation of currency, re-indexing, customer notifications and many more.

We are presenting the code to be implemented for successful cron job setup. Here, we have set the cron job to run every 5 minutes.

/usr/bin/php -c /[full path of magento root]/bin/magento cron::run >/dev/null 2>&1
/usr/bin/php -c /[full path of magento root]/update/cron.php >/dev/null 2>&1
/usr/bin/php -c /[full path of magento root]/bin/magento setup:cron:run >/dev/null 2>&1

Same as above, learn to setup cron job for Magento 1.x. If you have any comments or suggestions, please feel free to let us know.

Exit mobile version