Scheduled Backups

Automate your OpenClaw backups so you never lose work — local schedules are free, cloud schedules require Hobby or Pro.

Why Automate Backups

Manual backups are easy to forget. Scheduled backups run silently in the background, capturing your workspace state at regular intervals. If something breaks, you can restore from the last automatic snapshot.

Local Scheduled Backups

Local schedules create .tar.gz backups in ~/.clawon/backups/ via cron. Free on all plans.

# Enable local scheduled backups (default: every 12 hours)
npx clawon local schedule on

# Custom interval and retention
npx clawon local schedule on --every 6h --max-snapshots 10

# Include optional data
npx clawon local schedule on --include-memory-db
npx clawon local schedule on --include-sessions

# Encrypt scheduled backups
npx clawon local schedule on --encrypt

# Disable
npx clawon local schedule off

Cloud Scheduled Backups

Cloud schedules sync your workspace to Clawon's servers automatically. Requires a Hobby or Pro account.

# Enable cloud scheduled backups
npx clawon schedule on

# Custom interval
npx clawon schedule on --every 6h

# Encrypt cloud scheduled backups
npx clawon schedule on --encrypt

# Include secrets (requires --encrypt)
npx clawon schedule on --encrypt --include-secrets

# Disable
npx clawon schedule off

Configuring Intervals

Use the --every flag to set how often backups run:

IntervalFlagUse case
Every hour--every 1hActive development, frequent changes
Every 6 hours--every 6hRegular use
Every 12 hours--every 12hDefault, most users
Every 24 hours--every 24hLow-frequency use

Snapshot Retention

Use --max-snapshots to limit how many local backups are kept. Oldest snapshots are deleted when the limit is reached.

# Keep at most 5 local backups
npx clawon local schedule on --max-snapshots 5

Including Optional Data

By default, scheduled backups capture the same files as manual backups. Add flags to include extras:

  • --include-memory-db — SQLite memory search index
  • --include-sessions — chat history (can grow large)
  • --encrypt — AES-256-GCM encryption (requires CLAWON_ENCRYPT_PASSPHRASE env var)
  • --include-secrets — include credential files (cloud only, requires --encrypt)
npx clawon local schedule on --include-memory-db --include-sessions --every 12h

Checking Status

# See all active schedules (local + cloud)
npx clawon schedule status

This shows the cron schedule, last run time, next run time, and any errors.

How It Works

Clawon adds a cron entry to your user crontab (crontab -l). The entry runs npx clawon local backup (or npx clawon backup for cloud) at the configured interval.

macOS and Linux only. Scheduled backups use cron, which is not available on Windows. Windows users can use Task Scheduler manually with the same commands.

Encrypted Scheduled Backups

To encrypt scheduled backups, set the CLAWON_ENCRYPT_PASSPHRASE environment variable (interactive prompts aren't possible in cron). The CLI validates this at setup time.

# Set passphrase in your shell profile (~/.zshrc or ~/.bashrc)
export CLAWON_ENCRYPT_PASSPHRASE="your-passphrase"

# Enable encrypted local schedule
npx clawon local schedule on --encrypt

# Enable encrypted cloud schedule with secrets
npx clawon schedule on --encrypt --include-secrets

Warning: If you lose your passphrase, encrypted backups cannot be recovered. Store it somewhere safe.

Recommended Setup

For most users, we recommend:

# Local backups every 12 hours with memory index
npx clawon local schedule on --include-memory-db --max-snapshots 10

# Cloud backups daily (Hobby/Pro)
npx clawon schedule on --every 24h

Having trouble? Check the Troubleshooting guide.