Cron Jobs
All GSM Middleware scheduled tasks run via external cron (server crontab), not WordPress cron. This ensures reliable execution with precise timing.
Overview
The plugin requires the following scheduled tasks:
| Task | Frequency | Description |
|---|---|---|
| Order Exports | Every 60 min (configurable) | Sync orders from BigCommerce/WooCommerce |
| Inventory Imports | Every 60 min (configurable) | Sync inventory levels to storefronts |
| Tracking Imports | Once per 24 hours | Fetch tracking numbers from Business Central |
| Queue Processor | Dedicated systemd workers (recommended) or every 5 minutes via cron | Process webhook, inventory sync, and dispute queue jobs with atomic lock claims |
| Email Reports | Per-report schedule | Send configured email reports |
| Log Cleanup | Daily at 3 AM | Clean old log and history records |
Setup
Use the Crontab Generator tool to generate all required cron entries:
- Navigate to Tools → Crontab Generator
- Configure the PHP binary path and intervals
- Click Generate Crontab
- Copy the output to your server's crontab (
crontab -e) - Click Mark as Installed
Detailed Guides
- Cron Setup — Initial cron configuration
- Dedicated Queue Runners — systemd worker template for
cron/process-queue.php - Crontab Generator — Centralized cron management tool
- Tracking Sync — Tracking import details
- Inventory Sync — Inventory sync operations
- Reports — Email report schedules
- Log Cleanup — Automated log cleanup
Current Entry Points
The generator now points to these CLI scripts:
cron/order-sync.phpcron/inventory-sync.phpcron/tracking-sync.phpcron/process-queue.php
Queue Processing Modes
Use one of these queue execution models:
- Recommended: Dedicated
systemdworkers using[email protected]andworker_idarguments. - Fallback: Crontab entry invoking
cron/process-queue.phpevery 5 minutes.
Dedicated workers are preferred on busy sites because they avoid startup overhead and provide better concurrency control.