We are currently still building up the English documentation; not all sections have been translated yet. Please note that there may still be German screenshots or links to German pages even on pages that have already been translated. This guide mostly addresses English speaking users in Germany.
Setting up the task scheduler for exports
Your task/initial situation
Automating exports
- Open the task scheduler in the back end of JTL-Shop via Administration > Export > Export manager.
- Then click Create new task. The page Export formats opens.
- Use the Export formats drop-down menu to select the format to be created.
- Then, under Start date, set the time when the first export should take place and under Every X hours, specify how often the export should be repeated. The start date must have the following format: dd.mm.yyyy hh:mm.
- Click Create new task. You are forwarded to the page Export manager page. Your newly created schedule is listed there.
Starting exports
Automatically
The task scheduler can also be run automatically. With the NOVA template, this is possible via Cron taks; with the EVO template, a blind graphic is also available.
Manually
You can also trigger the export manually, regardless of whether the specified time window has already elapsed.
- Open the page Export manager in the back end of JTL-Shop via Administration > Export > Export manager.
- Click on the Trigger Cron manually button. The export is now carried out and the interval is reset.
Frequently asked questions
How and when are tasks processed in the task scheduler?
The tasks stored in the back end under Administration > Export > Export manager are processed in JTL-Shop as follows:
By default, the online shop tries to start the task schedule with every tenth time a page is opened. To do this, the server starts a server-to-server request (curl), which calls up the URL <ShopURL>/includes/Cron_inc.php. This starts the task scheduler. It processes parts of the tasks in the queue. The next time the task scheduler is called up, the next part of the tasks is processed. Thanks to this method, no further Cron tasks are necessary for an online shop with regular visitors. The tasks are triggered one after the other by page views.
Calling up the server-to-server request or triggering the task scheduler does not affect the loading time of the page.
By calling up the URL <ShopURL>/includes/Cron_inc.php, the processing of the tasks can be triggered manually. If no content is displayed on the page, either there are currently no tasks in the queue or a task process is currently being processed.
However, we strongly recommend installing a proper Cron task that is not dependent on regular page views but calls <shoproot>/includes/Cron_inc.php itself at fixed intervals.
Why are my planned tasks not being completed or completed only irregularly?
The task scheduler is not a real Cron task. This means that the tasks are not triggered at a fixed interval but are started by the page views in relation to the call-up time. This means that if a page is called up and the call-up time (per time stamp) is divisible by 10 without remainder (modulo 10), the task is started. On average, the task is triggered approximately every 10 page views and, under optimal conditions, also approximately at the interval specified by the “Every X hours” option. Due to low visitor numbers, tasks may be delayed or, in the case of very low visitor numbers, may even not be carried out at all for a time.
Newsletters and exports are both carried out automatically via the task scheduler. If the number of visitors to your JTL-Shop is low, the start of the task may be delayed, which leads to the newsletters or exports being sent late or even not sent at all.
Triggering the task scheduler via Cron tasks
If you can create your own Cron tasks (either Cron tasks on your own server or through external Cron calls), please follow the instructions below:
You can trigger the PHP script directly via Cron call.
If the Cron service runs on the same server as the shop, then the script is called up as follows (adapt the path to the online shop!):
php /pfadZumShop/includes/cron_inc.php
define('JOBQUEUE_LIMIT_M_EXPORTE', 250);
define('JOBQUEUE_LIMIT_JOBS', 3);
JOBQUEUE_LIMIT_M_EXPORTE describes the number of items exported per export format and Cron task call. Here you can enter values of several thousands.
JOBQUEUE_LIMIT_JOBS is the number of Cron tasks that are started one after the other via call.
With external Cron services (such as www.cronjob.de), it is sufficient to start the php script via URL call:
Example:
http://www.meinshop.de/includes/cron_inc.php
By default, 500 items per call are processed for export formats. This means that if you have entered 800 items and two export formats in the task scheduler, the Cron task must be started twice so that all tasks can be processed. Depending on the server capacity, you should allow a suitable amount of time between calls (approx. 2 minutes). You should choose a time period for calling the Cron tasks when as few shop visitors as possible are online.
Best practices: task scheduler and Cron tasks
For a smooth processing of tasks, the following things should be considered: