微算力 · API 导航与自营网关
API 接入 EN
未登录登录
✨

OpenClaw Backup & Restore

OpenClaw Backup & Restore · v1.0.3
安全 unknown 级 作者 darinrowe 公开目录收录
1.1k 下载 1 安装 3.5k 收藏 1 浏览

简介

OpenClaw Backup & Restore

原始描述

Backup and restore OpenClaw configuration, agents, sessions, and workspace to/from a private Git repository. Use when the user wants to manually trigger a ba...

通过你的 Agent 添加

安装目录:openclaw-backup-restore/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。

点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。

或者手动安装

Claude Code~/.claude/skills/openclaw-backup-restore/
Codex CLI~/.codex/skills/openclaw-backup-restore/
DeepSeek Harness~/.agents/skills/openclaw-backup-restore/

包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可; 目录名不用换,也不要把包直接解压到 skills 根目录。 技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。

技能正文


name: openclaw-backup-restore description: Backup and restore OpenClaw configuration, agents, sessions, and workspace to/from a private Git repository. Use when the user wants to manually trigger a backup, migrate to a new machine, or restore from a previous state.

OpenClaw Backup & Restore

A specialized skill for managing the lifecycle of your OpenClaw data. This skill utilizes an external Git-managed backup directory to keep your production environment clean while ensuring full recoverability.

Strategy

  1. Isolation: Git operations happen in a dedicated directory outside the live .openclaw runtime to avoid pollution.
  2. Minimalism: Large node_modules, logs, and temporary files are excluded.
  3. Redundancy: Regular backups can be scheduled via Cron.

Setup

Before using this skill, you must set your private backup repository URL in openclaw.json. This URL is used by the scripts to push and pull data.

openclaw config set skills.entries.openclaw-backup-restore.env.OPENCLAW_BACKUP_REPO "git@github.com:your-username/your-repo.git"

How to Backup

To trigger a manual backup and sync to your remote repository:

  1. The agent should execute the backup.sh script located within this skill's scripts/ directory.
  2. The script will:
    • Read the repo URL from the OpenClaw config.
    • Sync ${HOME}/.openclaw/ to ${HOME}/openclaw-backup/ using rsync (respecting .gitignore).
    • Generate a readable commit summary from changed paths (for example workspace/config/runtime/memory).
    • Commit and push to the remote main branch.

Trigger Phrases: "Backup OpenClaw now", "Sync my data to GitHub".


How to Restore

To restore your environment on a new or existing machine:

  1. Ensure your SSH key is added to your Git provider (e.g., GitHub).
  2. The agent should execute the restore.sh script located within this skill's scripts/ directory.
  3. The process involves:
    • Reading the repo URL from the OpenClaw config.
    • Cloning or pulling the latest backup from the configured repository.
    • Syncing files back to ${HOME}/.openclaw/.
    • Reinstalling node dependencies and running openclaw doctor --yes to fix environment paths.
  4. Restart the Gateway: openclaw gateway restart.

Trigger Phrases: "Restore OpenClaw from backup", "Migrate my data".


Technical Details

  • Backup Directory: ${HOME}/openclaw-backup
  • Source Directory: ${HOME}/.openclaw
  • Exclusions: Defined in the skill's .gitignore (includes node_modules/, logs/, completions/, tmp/, dist/).
  • Automatic Setup: The .gitignore file is included in this skill and will be copied to ${HOME}/openclaw-backup/ during the first backup run.

Recovery Checklist

If restoring to a completely new machine:

  1. Install OpenClaw CLI first.
  2. Set the OPENCLAW_BACKUP_REPO config value.
  3. Configure SSH access for your Git provider.
  4. Run the restore script provided by this skill.
  5. Run openclaw onboard if you need to re-install the daemon service.

正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。

标签

没有标签

同类 Skill