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.
To schedule a URL request (HTTP method): use a text browser such as lynx or a wget or curl command to request the URL through the web server. Copy the task URL from the module back office; do not replace it with the physical path to the PHP file.
Some modules also provide a PHP CLI command designed to run from the command line. In that case, follow the command and arguments supplied by the module, using the PHP environment required by the shop. The instruction to use a URL applies to the HTTP method and does not prohibit these documented CLI commands.
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.
For the HTTP method, copy the complete URL supplied by the module, including its parameters and any token. Do not replace this URL with a filesystem path.
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 an HTTP URL supplied by the module:
0 2 * * * lynx -dump "https://example.com/CRON_URL_COPIED_FROM_MODULE" > /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 an HTTP URL supplied by the module:
0 2 * * * curl -L "https://example.com/CRON_URL_COPIED_FROM_MODULE" > /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.
The example URLs are placeholders; replace them entirely with the module URL. The 2 AM schedule follows the scheduler’s timezone. Check the timezone, recommended frequency and result of the first call before automating.
Before choosing a third-party service, check its execution timeout and frequency limits. EasyCron’s free plan has limits and requires monthly renewal; check the current conditions on its website. Share a URL containing a token only with the service chosen to execute it.