1. Home
  2. Support
  3. Applications
  4. Setting up Crontabs for Magento

Setting up Crontabs for Magento

Please note Crontabs are only available on Linux hosting packages.


Steps to Take:

First we will need to enable Crontabs, so within your hosting control panel go to FTP/User Account > FTP User

You should be able to see the option for Crontab, to enable this you just need to click the blue off button.

This will then provide you with the option to edit the Crontab, to do this you just need to click on the edit option.

Now here is where we set the settings for the Crontab. To start with all the boxes should be empty as seen below.

Here’s an example of a full command and what it may look like:

 /hsphere/shared/php71/bin/php /hsphere/local/home/YOUR_USERNAME/YOUR_DOMAIN/cron.php > /dev/null 2>&1 

We have added “> /dev/null 2>&1” to the end of the command to prevent an email being sent out every time the command is run. We recommend you do this rather than not adding it.

We’ll now break down the format of the Crontab to better understand it.

Magento request you setup the Crontab as shown below:

*/5 * * * *  /bin/php /absolute/path/to/magento/cron.php

In short, this line means use PHP to run the cron.php file every 5 minutes. We need to make a few changes here to allow this to work on our servers.

*/5 * * * *  /hsphere/shared/php71/bin/php /absolute/path/to/magento/cron.php

or

*/5 * * * *  /hsphere/shared/php71/bin/php /absolute/path/to/magento/cron.php

After you’ve filled the fields in using the correct format, you should see something similar to below:

If you’re using the cron without the “ > /dev/null 2>&1” on the end, you will need to ensure the Mail-To box is filled out with your email address. When you are happy this has all been done, simply press the Submit button.

Once you’ve done so, you should have successfully just setup your Crontab to work with Magento.

Please note: Our examples use PHP 7.1, there are other PHP versions available which can be used for crons. Please see the php binary locations here.

Was this article helpful to you?

Last modified: 14/08/2019