How to set up cron
Cron is a scheduled task on the server. At regular intervals it calls an address (URL) or a command. Some WEB Vision modules need it for background work: sending documents, downloading exchange rates, retrying failed attempts or cleaning.
Which modules need cron
Section titled “Which modules need cron”| Module | What cron is for | Recommended frequency |
|---|---|---|
| Peppol e-invoices | Retrying attempts, delivery statuses, delayed documents | every 5 to 10 minutes (with a delay at least every 10 to 15 minutes) |
| Meta Pixel | The event queue and the product feed | at least once an hour |
| Abandoned carts | Sending reminders | once an hour |
| Review request | Sending requests | once an hour or once a day |
| ECB exchange rates | The daily rate download | once a day after 16:30 (Central European Time) |
| GeoIP database | Updating the database | Wednesday and Saturday morning |
| Lowest price (Omnibus) | Refreshing the index of lowest prices | once a day |
| PrestaShop cleaner | Automatic cleaning | three addresses: daily, weekly, monthly |
You will find the exact cron address in each module’s settings. It contains a secret token.
How to set up cron
Section titled “How to set up cron”One of the following ways is enough.
1. In the hosting administration
Section titled “1. In the hosting administration”Most hostings have a Cron or Scheduled tasks section.
- In the hosting administration open the cron section.
- Add a new task with the required schedule (per the table above).
- As the command enter one of these forms (copy the address from the module settings):
wget -q -O /dev/null "ADDRESS"curl -s "ADDRESS" > /dev/nullSome hostings also offer an option to Call a URL. Then you enter the address directly, without wget or curl.
2. On your own server (crontab)
Section titled “2. On your own server (crontab)”On the server run crontab -e and add a line. The first five fields are the time (minute, hour, day of month, month, day of week). Examples:
# every 10 minutes*/10 * * * * curl -s "ADDRESS" > /dev/null
# once an hour0 * * * * curl -s "ADDRESS" > /dev/null
# once a day at 16:30, Monday to Friday30 16 * * 1-5 curl -s "ADDRESS" > /dev/null3. With an external service
Section titled “3. With an external service”If your hosting has no cron, the address can be called regularly by an external service for scheduled URL calls (e.g. cron-job.org). In it you set the address from the module and the interval.
A command instead of an address
Section titled “A command instead of an address”Some modules (e.g. Meta Pixel for the product feed, the GeoIP database) also offer a command-line command, for example:
php /path/to/prestashop/modules/mv_geoip_updater/cron/update.phpIt also works while the shop is in maintenance. The exact command is in the module settings.
The server time zone
Section titled “The server time zone”The cron time follows the server’s time zone. If the server runs in UTC and a module recommends a time in Central European Time (e.g. ECB rates after 16:30), shift the time by one or two hours (two in summer, one in winter).
How to check that cron works
Section titled “How to check that cron works”- The module shows the time of the last run in its settings. It should appear after the first cron run.
- You can also open the address in a browser. The module usually answers with a short message (e.g. JSON).
- If nothing happens, see the Troubleshooting section in the module’s documentation.
Security
Section titled “Security”The cron address contains a secret token. Do not share it. If the address leaks, generate a new one in the module settings (the old one then stops working) and update it in the cron task.
Thank you for your answer.
We are sorry. Tell us what is missing or unclear:Write to support