Skip to content

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.

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.

One of the following ways is enough.

Most hostings have a Cron or Scheduled tasks section.

  1. In the hosting administration open the cron section.
  2. Add a new task with the required schedule (per the table above).
  3. 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/null

Some hostings also offer an option to Call a URL. Then you enter the address directly, without wget or curl.

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 hour
0 * * * * curl -s "ADDRESS" > /dev/null
# once a day at 16:30, Monday to Friday
30 16 * * 1-5 curl -s "ADDRESS" > /dev/null

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.

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.php

It also works while the shop is in maintenance. The exact command is in the module settings.

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).

  • 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.

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.

Was this article helpful?