For shop owners and staff

Scheduled tasks

Some work runs by itself: releasing expired stock reservations, checking AWB and e-Factura statuses, fetching BNR exchange rates, cleaning up old data. Settings → Scheduled tasks lists every one of these tasks, with when it runs next and how its last run went.

The server line it depends on

Scheduled tasks need one line in the crontab of the user the shop runs as:

* * * * * cd /path/to/shop && php artisan schedule:run >> /dev/null 2>&1

If the scheduler hasn't run in the last five minutes, the dashboard and the Scheduled tasks page say so, and show the line with your shop's path.

What you can change

For each task SyncSHOP ships with, you can:

  • change its schedule with the five cron fields (minute, hour, day, month, weekday). The page describes the schedule in words, for example Daily at 05:20, and lists the next five runs;
  • pick another time zone (the shop's time, Europe/Bucharest, is the default);
  • switch it off;
  • run it now, whether or not it is switched on;
  • go back to the default schedule.

Each task keeps a history of its runs for 30 days, and at least its last 20 runs whatever their age: when it started, how long it took, whether it succeeded, and what it printed. Passwords, tokens and keys are removed from the stored output.

A task that hasn't started 15 minutes after it was due is marked Late. A time before the shop was installed doesn't count, so a new shop starts with no late tasks.

Exchange rates from BNR

BNR exchange rates runs at 13:30 on banking days and reads the rates BNR published over the last ten banking days. If the server was down for a few days, the next run fills in the gap.

The run is marked as failed, and the rates already stored stay in use, when BNR can't be reached, answers with something other than its rates file, or hasn't published a new rate for more than four days. Invoices in another currency use the rate of their issue date, and prices shown in another currency use the newest one.

Releasing expired reservations

Eliberează rezervările expirate (release expired reservations) runs every 5 minutes. Stock held for abandoned carts and unpaid orders becomes available again once its reservation runs out.

Back-in-stock e-mails

Anunță clienții când produsele revin în stoc (tell shoppers when products are back in stock) runs every 15 minutes. For every product someone is waiting for, it checks the stock that can be sold online; once there is some, each waiting shopper gets one e-mail with a link to the product. See Customer accounts.

Affiliate commissions

Aprobă și anulează comisioanele afiliaților (approve and cancel affiliate commissions) runs every night at 04:10. It brings every pending commission up to date with returns, cancels those whose order was cancelled or came back, and approves those past their hold days, except those flagged for review. See Affiliates.

Expired quotes

Închide ofertele expirate (close expired quotes) runs every hour at :15. Offers past their date expire, and the cart of an offer accepted but not ordered is emptied. See Companies.

Loyalty points

Expiră punctele de fidelitate nefolosite (expire unused loyalty points) runs every night at 02:20: customers who neither earned nor spent points for the months set in Settings → Fidelitate lose their balance. See Loyalty points.

Marketplace orders

Sincronizează comenzile de pe marketplace (sync marketplace orders) runs every 5 minutes: it brings in new orders from the marketplaces switched on, accepts them there, and cancels in the shop what the buyer cancelled there. See Marketplace orders.

Product feeds

Reface feed-urile de produse (rebuild the product feeds) runs every night at 04:00 and rebuilds every active feed. Actualizează feed-urile după schimbări (update the feeds after changes) runs every 15 minutes and rebuilds the feeds built before the last change to a product, a price or the stock. See Product feeds.

Price history

Istoricul prețurilor (Omnibus) runs every night at 00:05 and records each variant's price. The storefront uses this history to show the lowest price of the last 30 days beside any reduced price, as the law requires.

Actualizează căutarea (update search) runs every minute and sends any changed products that haven't reached the search index yet; a background job usually does it at once. Verifică indexul de căutare (check the search index) runs at 03:30, compares the index with the products and re-indexes any that fell behind. When it finds differences, its run shows as failed, so you know the index had been out of date. Produse asemănătoare și cumpărate împreună (similar and bought-together products) runs at 03:50 and works out the related products shown under each product and in the cart. Cele mai vândute produse (best-selling products) runs at 03:55 and counts each product's sales over the last 90 days, for the best sellers on the home page and the Cele mai vândute sort.

Pausing everything

Pause all tasks stops every scheduled task from starting, for example during an incident or a large import. Tasks can still be run by hand. Resume tasks switches them back on.

Your own tasks

Add a task runs one of the allowed Artisan commands at a time you choose: the commands SyncSHOP's own tasks use, and a few safe maintenance commands (such as auth:clear-resets or model:prune). Any other command is refused, and commands may contain only letters, digits and : _ - = . , / @ \, so nothing can reach the server's shell. The server owner can allow more commands in config/syncshop.php (scheduler.allowed_commands). Adding or changing a task asks for your password again.

System (shell) commands are off unless the server owner sets SCHEDULER_ALLOW_SHELL=true in the shop's .env, and even then only the shop's owner (the Owner role) may define one: a shell command can reach everything the server's PHP user can.

Daylight saving time

Schedules follow the clock on the wall. When the clocks go back in October, a task set for 03:30 runs once, not twice. When they go forward in March and 03:30 never happens, it runs at the first minute after the change.