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.
A Simple to use Guide for Setting up Cron Jobs in #Magento2 https://t.co/NorR6M55WA
— MageComp (@theMageComp) February 26, 2016
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.