How to create a CRON task?
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 have to copy it from the module's back-office (click here to know how to do for the "Google Merchant Center" module or click here to know how to do for the "Dynamic Ads + Pixel" module).
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 for the "Google Merchant Center" module (this the same principle for the "Dynamic Ads + Pixel" module):
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 and the text based browser installed on the server is Lynx.
(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 URL to execute (click here to know how to retreive it) and schedule it, after registration.
Other FAQs in this category
- How to fill my shop's URL?
- My shop uses several currencies: how to make Google detect the correct currency?
- How to only export products that are available for selling?
- How to match my products with Google categories?
- How to automatically update my feeds (on-the-fly output or CRON task)?
- Do I need to rewrite numeric values into the combination URLs?
- Do I have to ask the module to include the attribute IDs into combination URLs?
- What does "Too many attribute values for attribute: size (color)" Google error mean?
- What is the simple ID?
- How to create custom labels ?
- How to import my feeds in Google Shopping ?
- How to create "size type", "size system" and "adult" tags?
- Why was my selection of categories not properly saved ?
- How to configure my module ?