OpenClaw Backup

Backup and restore OpenClaw data. Use when user asks to create backups, set up automatic backup schedules, restore from backup, or manage backup rotation. Handles ~/.openclaw direc…

alex3alex

@alex3alex

What This Skill Does

Creates, restores, and rotates backups of the OpenClaw configuration directory (~/.openclaw), including configs, credentials, agents, workspace, Telegram session, and cron tasks. Excludes cache and log files. Supports manual backups, cron-scheduled daily backups with notification, and automatic rotation keeping the last 7 backups.

Replaces manual file copying and cron scripting for OpenClaw backup management by providing a dedicated backup script with built-in rotation and restore instructions.

When to Use It

  • Create a one-time backup of your OpenClaw configuration and workspace
  • Set up a daily automatic backup schedule with notification
  • Restore OpenClaw from a previous backup after a system failure or migration
  • Verify what files are included and excluded in the backup archive
  • Clean up old backups automatically by relying on the rotation policy

Install

$ openclaw skills install @alex3alex/openclaw-backup

OpenClaw Backup

Backup and restore OpenClaw configuration, credentials, and workspace.

Create Backup

Run the backup script:

./scripts/backup.sh [backup_dir]

Default backup location: ~/openclaw-backups/

Output: openclaw-YYYY-MM-DD_HHMM.tar.gz

What Gets Backed Up

  • openclaw.json — main config
  • credentials/ — API keys, tokens
  • agents/ — agent configs, auth profiles
  • workspace/ — memory, SOUL.md, user files
  • telegram/ — session data
  • cron/ — scheduled tasks

Excluded

  • completions/ — cache, regenerated automatically
  • *.log — logs

Setup Daily Backup with Cron

Use OpenClaw cron for daily backups with notification:

{
  "name": "daily-backup",
  "schedule": {"kind": "cron", "expr": "0 3 * * *", "tz": "UTC"},
  "payload": {
    "kind": "agentTurn",
    "message": "Run ~/.openclaw/backup.sh and report result to user."
  },
  "sessionTarget": "isolated",
  "delivery": {"mode": "announce"}
}

Restore

See references/restore.md for step-by-step restore instructions.

Quick restore:

openclaw gateway stop
mv ~/.openclaw ~/.openclaw-old
tar -xzf ~/openclaw-backups/openclaw-YYYY-MM-DD_HHMM.tar.gz -C ~
openclaw gateway start

Rotation

Script keeps last 7 backups automatically.

Top skills in this category