OpenClaw Backup R2
/install backup-to-r2
\r \r
OpenClaw Backup → Cloudflare R2 (via restic)\r
\r
This skill helps the user create complete, encrypted, off-site backups of their OpenClaw installation and restore them on any machine. It backs up everything OpenClaw's built-in .bak misses: credentials, agents, workspace, and cron — not just openclaw.json.\r
\r
When to use\r
\r
- The user wants to back up their OpenClaw setup (config, agents, credentials).\r
- The user lost agents/config (e.g., after
openclaw doctor --fix) and wants protection going forward.\r - The user wants to restore a backup or migrate OpenClaw to a new PC.\r
- The user wants automatic daily backups.\r \r
What it backs up\r
\r
openclaw backup create --verify produces a verified .tar.gz containing config, credentials, agents, workspace, and cron. restic then encrypts and deduplicates it locally and uploads to Cloudflare R2. Retention keeps 7 daily + 4 weekly + 6 monthly snapshots.\r
\r
Prerequisites (guide the user to set these up)\r
\r
- restic installed (on PATH or at
./restic/restic.exe).\r - A Cloudflare R2 bucket + S3 API token.\r
- Copy
.env.example→.envand fillRESTIC_REPOSITORY,AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY.\r - Create
.restic-passwith a strong password. Critical: this is the only key to the encrypted backups — store it safely and separately. Without it, restore is impossible.\r - Initialize once:
restic init.\r \r
Never commit
.envor.restic-pass. They are git-ignored. Never print their contents.\r \r
Running a backup\r
\r
.\backup.ps1\r
```\r
This runs `openclaw backup create --verify`, uploads via restic to R2, prunes old snapshots, and removes the local tar. Logs go to `logs/`.\r
\r
## Testing a restore (safe, non-destructive)\r
\r
```powershell\r
. est-restore.ps1\r
```\r
Downloads the latest snapshot, extracts it, and validates with `openclaw backup verify`. Does **not** touch the live `.openclaw`.\r
\r
## Restoring (any PC)\r
\r
Copy the `portable/` folder (with `restic/restic.exe`, `.env`, `.restic-pass`) to the target machine and run:\r
```powershell\r
.\portable\restore-portable.ps1\r
```\r
It stops the gateway, pulls the latest backup from R2, and installs to `%USERPROFILE%\.openclaw`, **preserving** the current `.openclaw` as `.openclaw.backup-\x3Cdate>` first.\r
\r
## Automating daily backups (Windows)\r
\r
Register a Task Scheduler job that runs `backup.ps1` daily with `-StartWhenAvailable` so it catches up if the PC was off. See the README for the exact `Register-ScheduledTask` command.\r
\r
## Safety notes\r
\r
- Always confirm the user has saved their `.restic-pass` somewhere safe before relying on backups.\r
- When helping configure, never echo secret values; have the user paste them into `.env`/`.restic-pass` themselves.\r
- The restore preserves the existing `.openclaw` as a timestamped backup, so a restore is reversible.\r
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install backup-to-r2 - 安装完成后,直接呼叫该 Skill 的名称或使用
/backup-to-r2触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
OpenClaw Backup R2 是什么?
Set up and run complete, encrypted, off-site backups of an OpenClaw install to Cloudflare R2 via restic, plus portable restore. Use when the user wants to ba... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 56 次。
如何安装 OpenClaw Backup R2?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install backup-to-r2」即可一键安装,无需额外配置。
OpenClaw Backup R2 是免费的吗?
是的,OpenClaw Backup R2 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
OpenClaw Backup R2 支持哪些平台?
OpenClaw Backup R2 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 OpenClaw Backup R2?
由 SIA - Serviços IA & Automações(@servicosmkt)开发并维护,当前版本 v1.0.0。