How to set up the Magento cron job / scheduled tasks

The Magento cron job is responsible for processing all scheduled/periodic tasks for your store, such as:

  • Update Catalog Price rules
  • Generating Google Sitemaps
  • Sending Newsletters
  • Generating database backups
  • Cleaning of Log tables
  • And much more..

It is important that the cron job is configured correctly in your hosting account for all aspects of Magento to work. A cron is a Linux program that is used to schedule jobs (commands or shell scripts) to run periodically at fixed times, dates, or intervals.

Steps to set up the Magento cron job

Step 1

To add the cron job, the first step is to log into your cPanel account and click on the Cron Jobs menu item in the Advanced section.

Step 2

You will now get to the screen where you can configure the cron jobs for your account. If you would like to receive an email report after each cron is run, enter your email address and click on Update Email. Then, under Add New Cron Job, you need to enter the following:

  1. Select how often the cron should run (every 5-10 minutes is recommended);
  2. Enter the command to run. In case of Magento, this will usually be:
    /bin/sh /home/<username>/public_html/ 
    This assumes Magento is installed in the root folder of your account ("public_html"). Make sure to put in your username.
  3. Click the Add New Cron Job button.
  4. You should now see a new entry in the Current Cron Jobs table below.
Add Magento Cron Job

Was this answer helpful?