Scheduled X-Cart Tasks

Learn how to configure a server to run scheduled tasks for X-Cart.

Olga Tereshina avatar
Written by Olga Tereshina
Updated over a week ago

Some X-Cart features require periodic execution of miscellaneous service and maintenance tasks, including, but not limited to:

  • the execution of event tasks (i.e., tasks that are launched on an event; examples of such tasks are exporting and importing of data from/into X-Cart);

  • the sending of abandoned cart reminder email messages for the addon "Abandoned Cart Reminder";

  • the automated re-generation of the sitemap and the XML sitemap, etc.


X-Cart 5.4.x:

The execution of said periodic tasks can be triggered by running the script console.php located in the X-Cart root. Automated periodic execution of the script console.php can be implemented by using a scheduling service that allows users to schedule jobs (commands or shell scripts) at defined times or regular intervals. Most operating systems provide such a service.

For example, on Unix-like systems, you can set up a cron job for running console.php by manually editing the crontab file in your home directory or by using the web interface for managing cron jobs provided by your hosting provider. The command that you should configure your server to run in the background at regular intervals is:

php console.php --target=cron

where “console.php” must be replaced with the full path to the console.php script in your X-Cart installation. On a Windows server, a similar setup can be implemented using the Windows Task Scheduler.

We recommend setting the frequency for running console.php to once every 5-10 minutes; this should be sufficient for most tasks.

Please note that for security reasons the script console.php can only be run in the console user interface (not in the browser). It is not possible to use any free cron services available online to run it.


X-Cart 5.5.x:

You can automate the periodic execution of service tasks using cron. To run such tasks, use the command

php bin/console xcart:cron

We recommend setting the frequency for running the command to once every 5-10 minutes; this should be sufficient for most tasks.

Did this answer your question?