Install
openclaw skills install snapshotBackup and restore the .openclaw agent folder — encrypted snapshots pushed to a private GitHub repo. Use this skill whenever the user mentions backup, restor...
openclaw skills install snapshotEncrypted backup and restore for the ~/.openclaw agent folder.
Backups are GPG-encrypted, chunked for GitHub's 100MB file limit, and pushed to a private repo.
Each backup version lives in its own folder with a manifest:
backups/openclaw-{timestamp}/
├── manifest.json
├── part-000.gpg
├── part-001.gpg
└── ...
Last 10 backups are kept; older ones are auto-deleted.
Before running any command, verify:
sudo apt-get update && sudo apt-get install -y gnupg gpg-agentpython3 scripts/setup.pyThe scripts need these values: BACKUP_PASSWORD, GITHUB_PAT, GITHUB_USERNAME, and optionally REPO_NAME (defaults to openclaw-transport).
Provide them via any of these methods (checked in this order):
OpenClaw's env file (recommended): Add to ~/.openclaw/.env:
BACKUP_PASSWORD=your-strong-password
GITHUB_PAT=ghp_xxxxxxxxxxxxxxxxxxxx
GITHUB_USERNAME=YourGitHubUsername
REPO_NAME=openclaw-transport
Then in openclaw.json, just enable the skill:
"skills": { "entries": { "snapshot": { "enabled": true } } }
Skill-local env file: Copy env-example.txt to .env in this skill's directory and fill in values. Useful for standalone usage outside OpenClaw.
Shell environment: Export the variables in your shell profile.
All scripts live in the scripts/ subdirectory of this skill.
python3 <skill-path>/scripts/backup.py
Non-interactive. Compresses, encrypts, chunks if needed, pushes to GitHub.
Auto-deletes versions older than the most recent 10.
# Restore the latest version (non-interactive, best for AI agents)
python3 <skill-path>/scripts/restore.py --latest
# Restore a specific version by timestamp
python3 <skill-path>/scripts/restore.py --version 20260227-120000
# List available versions without restoring
python3 <skill-path>/scripts/restore.py --list
# Interactive mode (prompts user to pick — use only in human-attended sessions)
python3 <skill-path>/scripts/restore.py
python3 <skill-path>/scripts/setup.py
Safe to run multiple times. Installs GPG if missing, clones or syncs the transport repo.
Always run setup.py before backup or restore. It's idempotent (safe to run every time) and ensures GPG is installed, the transport repo exists, and the local repo is synced with GitHub. This prevents issues like missing repos, stale local state, or remotely deleted backups not being reflected locally.
python3 <skill-path>/scripts/setup.pypython3 <skill-path>/scripts/backup.pypython3 <skill-path>/scripts/setup.pypython3 <skill-path>/scripts/restore.py --latestopenclaw gateway restartpython3 <skill-path>/scripts/setup.pypython3 <skill-path>/scripts/restore.py --list.env file with credentials (help them create one from env-example.txt if not)python3 <skill-path>/scripts/setup.pypython3 <skill-path>/scripts/setup.pypython3 <skill-path>/scripts/restore.py --list to show available versionspython3 <skill-path>/scripts/restore.py --version <timestamp>.env files are excluded from backups — both ~/.openclaw/.env (OpenClaw root secrets) and the skill's own .env. Credentials never end up in encrypted archives.~/openclaw-transport/) lives outside .openclaw and is not backed up..openclaw.openclaw gateway restart