Overview
Mission Control’s scheduler runs automated maintenance tasks in the background without manual intervention. Handle database backups, stale data cleanup, agent heartbeat checks, webhook retries, and Claude Code session scanning.Accessing Scheduler Status
Navigate to Settings
Open Background Tasks
View Task Status
Via API
Query scheduler status programmatically:Scheduled Tasks
Five background tasks run automatically:1. Auto Backup
Purpose: Create database backups to prevent data loss. Schedule: Daily at ~3 AM UTC (relative to process start time) What It Does:Create Backup
.data/backups/mc-backup-{timestamp}.dbLog Event
Prune Old Backups
Backup File Format
Backup File Format
mc-backup-YYYY-MM-DD_HH-MM-SS.dbExample: mc-backup-2026-03-04_03-00-00.db2. Auto Cleanup
Purpose: Remove stale records based on retention policies. Schedule: Daily at ~4 AM UTC What It Does:Delete Old Activities
Delete Old Audit Logs
Delete Old Notifications
Delete Old Pipeline Runs
Clean Token Usage File
tokens.json older than configured daysLog Summary
0 to disable cleanup for a specific record type. Records will be kept indefinitely.3. Agent Heartbeat Check
Purpose: Mark agents offline if they haven’t sent a heartbeat recently. Schedule: Every 5 minutes What It Does:Query Stale Agents
status != 'offline' and last_seen < thresholdMark Offline
offline and set updated_at timestampLog Activity
Create Notification
Audit Log
4. Webhook Retry
Purpose: Retry failed webhook deliveries with exponential backoff. Schedule: Every 60 seconds What It Does:Query Failed Deliveries
status = 'failed' and next_retry <= nowCheck Circuit Breaker
Retry Delivery
Update Status
success or increment retry countCalculate Backoff
next_retry using exponential backoff (1s, 2s, 4s, 8s, 16s, …)Circuit Breaker Behavior
Circuit Breaker Behavior
- No further retry attempts
- Delivery status set to
circuit_open - Operator notification created
- Manual intervention required to reset
5. Claude Session Scan
Purpose: Auto-discover and track local Claude Code sessions. Schedule: Every 60 seconds What It Does:Scan Projects Directory
~/.claude/projects/ for active projectsParse JSONL Transcripts
Extract Token Usage
Calculate Cost
Store in Database
source = 'claude-code'Task Configuration
Enable/disable tasks via Settings API:Enable a Task
Disable a Task
View All Settings
Retention Policies
Configure how long records are kept:- Activities
- Audit Log
- Notifications
- Pipeline Runs
- Token Usage
retention.activitiesDefault: 90 daysActivity feed entries (task updates, agent changes, etc.)Set Retention Policy
Scheduler Initialization
The scheduler starts automatically when Mission Control launches:- Agent Sync — Sync agents from
openclaw.jsonon startup - Task Registration — Register all 5 background tasks
- Staggered Start — Backup scheduled for ~3 AM, cleanup for ~4 AM (relative to start time)
- Tick Loop — Check every 60 seconds for due tasks
Startup Log
Monitoring Task Execution
Last Run Information
Each task tracks:- lastRun — Timestamp of most recent execution
- nextRun — Timestamp of next scheduled execution
- running — Boolean indicating if task is currently executing
- lastResult — Result of most recent execution:
ok— Success/failure booleanmessage— Human-readable summarytimestamp— When result was recorded
Example Result Messages
- Auto Backup:
"Backup created (2456KB)" - Auto Cleanup:
"Cleaned 147 stale records" - Heartbeat Check:
"All agents healthy"or"Marked 2 agent(s) offline: researcher-01, analyst-02" - Webhook Retry:
"Retried 3 deliveries: 2 succeeded, 1 failed" - Claude Scan:
"Synced 2 sessions: mission-control, demo-project"
Audit Trail
All scheduled task executions are logged to the audit trail:Troubleshooting
Task Not Running
Task Not Running
- Check if task is enabled in settings
- Verify
nextRuntimestamp is in the past - Confirm scheduler initialized (check startup logs)
- Look for errors in
lastResult.message
Backup Failing
Backup Failing
- Verify
.data/backups/directory exists and is writable - Check disk space:
df -h .data/ - Review permissions:
ls -la .data/backups/ - Check audit log for detailed error message
Cleanup Not Deleting Records
Cleanup Not Deleting Records
- Confirm retention policies are set (not 0)
- Verify records are older than retention days
- Check if task is enabled:
general.auto_cleanup = true - Manually trigger cleanup and review result
Agents Marked Offline Too Quickly
Agents Marked Offline Too Quickly
Best Practices
Backup Strategy
Enable Auto Backup
general.auto_backup = true in production.Set Retention Count
External Backup
.data/backups/ to offsite storage weekly (e.g., S3, Google Drive).Test Restoration
Retention Tuning
- High-traffic systems — Reduce retention to 30-60 days to save disk space
- Audit compliance — Increase audit log retention to 365+ days
- Development — Use shorter retention (7-14 days) to keep database small
Heartbeat Tuning
- Reliable networks — 10-minute timeout is fine
- Unreliable networks — Increase to 20-30 minutes to avoid false positives
- Local development — Consider disabling heartbeat checks entirely