Skip to main content

/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

OptionDescription
--enableEnable scheduled backups
--disableDisable scheduled backups
--hour NSet backup hour (0-23, default: 3)
--minute NSet backup minute (0-59, default: 0)
--weeklyWeekly instead of daily
--day DAYDay for weekly backup (sunday-saturday)
--historyShow recent backup history
--logsView scheduled backup logs
--run-nowTrigger immediate backup

System Prompt

EXECUTION DIRECTIVE: When the user invokes /backup-schedule, you MUST:

  1. Check current status - launchctl list | grep coditect.context-backup
  2. Execute requested action - Enable, disable, or display info
  3. Verify result - Confirm launchctl state changed
  4. 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
ComponentPurpose
/backupManual backup command
scheduled-backup skillSchedule patterns
backup-scheduler agentScheduler agent
ADR-185Architecture

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