Migrating from Cron
Step up from a timer to a coordination primitive. Move crontab entries to CueAPI cues.
Why migrate?
Cron is a timer. CueAPI is a coordination primitive. A cron expression is just one of many ways to declare when a cue fires. When you migrate from cron to CueAPI, you are not swapping one scheduler for another. You are stepping up to coordination infrastructure that tracks every handoff and verifies every outcome.
| Feature | Cron | CueAPI |
|---|---|---|
| API-managed schedules | No | Yes |
| Pause/resume without editing config | No | Yes |
| Execution history | No | Yes |
| Automatic retries | No | Yes (3 attempts) |
| Outcome reporting and verification | No | Yes |
| Signed webhook delivery | No | Yes |
| Works across machines | No | Yes (worker transport) |
| Visibility | Check logs manually | Dashboard + API |
Step 1: Identify your cron jobs
List your current crontab:
crontab -lExample output:
0 9 * * * /usr/bin/python3 /scripts/daily_report.py
*/15 * * * * /scripts/sync_inventory.sh
0 0 1 * * /scripts/monthly_cleanup.py
Step 2: Install the CueAPI CLI and worker
pip install cueapi cueapi-worker
cueapi loginStep 3: Create a worker config
Create cueapi-worker.yaml mapping your scripts to handler tasks:
handlers:
daily-report:
cmd: "python3 /scripts/daily_report.py"
timeout: 120
sync-inventory:
cmd: "/scripts/sync_inventory.sh"
timeout: 60
monthly-cleanup:
cmd: "python3 /scripts/monthly_cleanup.py"
timeout: 300Step 4: Create cues for each job
# Daily report at 9 AM
cueapi create \
--name "daily-report" \
--cron "0 9 * * *" \
--transport worker \
--payload '{"task": "daily-report"}'
# Inventory sync every 15 minutes
cueapi create \
--name "sync-inventory" \
--cron "*/15 * * * *" \
--transport worker \
--payload '{"task": "sync-inventory"}'
# Monthly cleanup
cueapi create \
--name "monthly-cleanup" \
--cron "0 0 1 * *" \
--transport worker \
--payload '{"task": "monthly-cleanup"}'Step 5: Start the worker
cueapi-worker start --config cueapi-worker.yamlStep 6: Verify and remove old cron entries
Check that your cues are running:
cueapi list
cueapi get cue_xxxxxOnce confirmed, remove the old crontab entries:
crontab -e
# Remove the migrated linesStep 7: Install as a service (optional)
To ensure the worker starts automatically:
# macOS
cueapi-worker install-service --config /path/to/cueapi-worker.yaml
# Linux
cueapi-worker install-service --config /path/to/cueapi-worker.yaml
systemctl --user enable cueapi-workerCron expression mapping
Your existing cron expressions work as-is in CueAPI. The syntax is identical:
# These are the same in crontab and CueAPI
0 9 * * * → --cron "0 9 * * *"
*/15 * * * * → --cron "*/15 * * * *"
0 0 1 * * → --cron "0 0 1 * *"
Note
CueAPI cron expressions support timezone specification. If your crontab runs in a specific timezone, add --timezone when creating the cue.
What you gain
After migration, each former cron job now has:
- Pause/resume without editing configs
- Execution history visible in the dashboard
- Automatic retries if a script fails
- Outcome reporting so you know what happened
- Usage tracking per plan