How to create a CRON task?

If you are not comfortable with technical area, please ask your webmaster for help.

 

Here are two ways to set up a CRON task:

 

Setting up via crontab (for users with technical / Linux knowledge)

 

CRON tasks are usually set up by editing a crontab file and adding a line.

IMPORTANT : The CRON’s line you’re going to configure must be executed as a web server request by prefixing your line with lynx application (text browser), or any wget / curl commands that implies to use the web server engine. This allows that your request will be successfully executed in the web server context and get all the PHP environment variables as needed for your PrestaShop execution.

Into this CRON's line, you have to indicate the CRON's URL. You will find the CRON's URL in your module's back-office.

WARNING : DO NOT put the physical path of the script, and only put the script URL that you can find in the module’s back-office.

Configure this CRON's line by using the CRON's URL copied from your back-office and by deciding on the frequency (cycle) of updates. Go to this website for a detailled explanation of cycles.

Example with lynx for the "Google Merchant Center" module (this the same principle for the other modules):

0 2 * * * lynx -dump "http://www.mysite.com/modules/gsnippetsreviews/cron.php" > /dev/null
This example will execute the URL every night at 2:00AM
(don't forget the quotes before and after the URL, as it's indicated in red in the example above)

Example with curl for the "Google Merchant Center" module (this the same principle for the other modules):

0 2 * * * curl -L "http://www.mysite.com/modules/gsnippetsreviews/cron.php" > /dev/null
This example will execute the URL every night at 2:00AM
(don't forget the quotes before and after the URL, as it's indicated in red in the example above)

 

---> For more information about the crontab program, click here

 

Of course, if you choosed to set up a CRON task for each feed, you have to configure as many CRON lines as there are different feed URLs.

 

Setting up via an online service

 

You can also use a free online service such as easycron and just enter there the CRON's URLs to execute and schedule them, after registration.