Magento Cron Job is an essential component of the platform that is ideal for executing scripts at predefined intervals. It's a recommendation to run cron every 5 minutes for a typical middle-sized Magento shop. If you set up cron job for running every 5 minutes and use SSH, the command which is responsible for the schedule is as follows
*/5 * * * *
The commands used to run cron are different for various Magento versions.
Magento 1.X
sh /path/to/directory/magento/site/root/cron.sh
Magento 2.X
php /path/to/directory/magento/site/root/bin/magento -- --quiet cron:run
Add a new Magento Cron task via SSH
Login to the server via SSH. Run crontab -e command to add a cron task. At this point you will see a text editor, where you can add or edit cron tasks. Starting from a new line, add the following record:
*/5 * * * * sh /path/to/your/magento/site/root/cron.sh
Add a new Magento Cron task via cPanel
To set up a new cron task in Magento via cPanel, log into your site’s configuration panel at
http://mymagentosite.com:2082/ or https://mymagentosite.com:2083/.
Then, enter cron into the search field, and you’ll see a Cron jobs option in the Advanced section.
No comments:
Post a Comment