⏰ Cron Jobs
PulseHub uses a cron runner (cron.php) to handle background tasks — polling email inboxes, processing automations, retrying failed webhooks, and cleaning up old data.
Overview
cron.php supports two modes:
| Mode | How it works | Best for |
|---|---|---|
| Web URL | Call cron.php?token=YOUR_SECRET&job=all via browser or hosting panel | Shared hosting (cPanel, Plesk) |
| CLI | Run php cron.php all from terminal | VPS / dedicated servers |
Available jobs:
| Job | Description |
|---|---|
all | Runs all jobs in sequence |
email | Polls active IMAP email channels |
automations | Processes pending automation events |
webhooks | Retries failed webhook events |
cleanup | Prunes old SSE/automation/webhook events |
Setup — Shared Hosting (cPanel / Plesk / DirectAdmin)
Option A: URL-Based Cron (Recommended)
- Log in to your hosting panel
- Go to Cron Jobs
- Set schedule to Every Minute (
* * * * *) - Paste:
wget -q -O /dev/null "https://yourdomain.com/cron.php?token=YOUR_CRON_SECRET&job=all"
Or using curl:
curl -s "https://yourdomain.com/cron.php?token=YOUR_CRON_SECRET&job=all" > /dev/null 2>&1
Tip: Copy the full URL from Settings → Cron Job URL in PulseHub.
Option B: CLI-Based Cron
php /home/yourusername/public_html/cron.php all
Option C: External Cron Service
Use cron-job.org, EasyCron, or SetCronJob and point it at your cron URL. Set to run every 1–5 minutes.
Setup — VPS / Dedicated Server
* * * * * php /var/www/pulsehub/cron.php all >> /var/log/pulsehub_cron.log 2>&1
Job Details
email — IMAP Polling
Connects to all active email channels via IMAP, searches for UNSEEN messages, imports them as conversations. If imap extension is missing, the job logs a skip message and exits cleanly.
automations — Process Pending Events
Selects up to 100 pending events, evaluates rules, executes actions. Events are marked processing before evaluation to prevent double-processing.
webhooks — Retry Failed Events
Retries failed webhooks (up to 5 attempts within 24 hours).
cleanup — Prune Old Data
- SSE events older than 24 hours
- Processed automation events older than 7 days
- Processed webhook events older than 30 days
Security
- Web mode requires a secret token (generated during installation, stored in
config/app.php) - CLI mode doesn't require a token
- Token comparison uses
hash_equals()to prevent timing attacks