/backup-schedule - Manage Scheduled Backups
Configure and manage automatic scheduled backups.
Usage
# View current schedule status
/backup-schedule
# Enable daily backups at 3 AM (default)
/backup-schedule --enable
# Enable with custom time
/backup-schedule --enable --hour 2 --minute 30
# Enable weekly backups
/backup-schedule --enable --weekly --day sunday --hour 3
# Disable scheduled backups
/backup-schedule --disable
# Show backup history
/backup-schedule --history
# View logs
/backup-schedule --logs
# Test run (manual trigger)
/backup-schedule --run-now
Options
| Option | Description |
|---|---|
--enable | Enable scheduled backups |
--disable | Disable scheduled backups |
--hour N | Set backup hour (0-23, default: 3) |
--minute N | Set backup minute (0-59, default: 0) |
--weekly | Weekly instead of daily |
--day DAY | Day for weekly backup (sunday-saturday) |
--history | Show recent backup history |
--logs | View scheduled backup logs |
--run-now | Trigger immediate backup |
System Prompt
EXECUTION DIRECTIVE:
When the user invokes /backup-schedule, you MUST:
- Check current status -
launchctl list | grep coditect.context-backup - Execute requested action - Enable, disable, or display info
- Verify result - Confirm launchctl state changed
- Report outcome - Show schedule details or error
Implementation
PLIST=~/Library/LaunchAgents/ai.coditect.context-backup.plist
# Check status
launchctl list | grep coditect.context-backup
# Enable
launchctl load "$PLIST"
# Disable
launchctl unload "$PLIST"
# Manual trigger
launchctl start ai.coditect.context-backup
# View logs
tail -50 ~/.coditect/logs/backup-scheduled.log
# View history
cat ~/PROJECTS/.coditect-data/context-storage/backup-history.json | python3 -m json.tool | tail -50
Output Format
Status Display
┌─────────────────────────────────────────────────────────────┐
│ SCHEDULED BACKUP STATUS │
├─────────────────────────────────────────────────────────────┤
│ Status: ENABLED │
│ Schedule: Daily at 03:00 AM │
│ Last Run: 2026-01-18 03:00:12 (Success) │
│ Next Run: 2026-01-19 03:00:00 │
│ Log File: ~/.coditect/logs/backup-scheduled.log │
│ │
│ Recent Backups: │
│ • 2026-01-18 03:00 - 1.92GB - Success │
│ • 2026-01-17 03:00 - 1.91GB - Success │
│ • 2026-01-16 03:00 - 1.90GB - Success │
└─────────────────────────────────────────────────────────────┘
Examples
Enable Default Schedule
/backup-schedule --enable
# Enables daily backup at 3:00 AM
Custom Schedule
/backup-schedule --enable --hour 2 --minute 30
# Enables daily backup at 2:30 AM
Weekly Backup
/backup-schedule --enable --weekly --day sunday --hour 4
# Enables weekly backup on Sunday at 4:00 AM
Check History
/backup-schedule --history
# Shows last 10 backups with status
Related Components
| Component | Purpose |
|---|---|
| /backup | Manual backup command |
| scheduled-backup skill | Schedule patterns |
| backup-scheduler agent | Scheduler agent |
| ADR-185 | Architecture |
Completion Checklist
Before marking complete:
- Checked current launchctl status
- Executed requested action (enable/disable/info)
- Verified state change
- Displayed appropriate output
Failure Indicators
This command has FAILED if:
- launchctl command fails
- Plist file not found
- Permission denied on logs
Version: 1.0.0 Created: 2026-01-18