Skip to main content

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:

TaskFrequencyDescription
Order ExportsEvery 60 min (configurable)Sync orders from BigCommerce/WooCommerce
Inventory ImportsEvery 60 min (configurable)Sync inventory levels to storefronts
Tracking ImportsOnce per 24 hoursFetch tracking numbers from Business Central
Queue ProcessorDedicated systemd workers (recommended) or every 5 minutes via cronProcess webhook, inventory sync, and dispute queue jobs with atomic lock claims
Email ReportsPer-report scheduleSend configured email reports
Log CleanupDaily at 3 AMClean old log and history records

Setup

Use the Crontab Generator tool to generate all required cron entries:

  1. Navigate to Tools → Crontab Generator
  2. Configure the PHP binary path and intervals
  3. Click Generate Crontab
  4. Copy the output to your server's crontab (crontab -e)
  5. Click Mark as Installed

Detailed Guides

Current Entry Points

The generator now points to these CLI scripts:

  • cron/order-sync.php
  • cron/inventory-sync.php
  • cron/tracking-sync.php
  • cron/process-queue.php

Queue Processing Modes

Use one of these queue execution models:

  1. Recommended: Dedicated systemd workers using [email protected] and worker_id arguments.
  2. Fallback: Crontab entry invoking cron/process-queue.php every 5 minutes.

Dedicated workers are preferred on busy sites because they avoid startup overhead and provide better concurrency control.