返回顶部
s

self-backup自我备份

Backup important OpenClaw workspace files to a GitHub repository. Use when: (1) user wants to backup workspace configuration, (2) sync OpenClaw settings to GitHub, (3) preserve automation scripts and personal configuration, (4) create remote backup of AGENTS.md, SOUL.md, MEMORY.md, and other workspace files. Configurable for any GitHub repository.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
310
下载量
免费
免费
1
收藏
概述
安装方式
版本历史

self-backup

自我备份

将关键的OpenClaw工作区文件备份到您的GitHub仓库,以确保安全保存和版本控制。

设置

1. 安装GitHub CLI(如果尚未安装)

bash

Ubuntu/Debian

sudo apt install gh

macOS

brew install gh

其他平台:https://cli.github.com/

2. 登录GitHub

bash gh auth login

3. 配置您的备份仓库

在备份脚本中编辑配置或设置环境变量:

bash

设置您的仓库URL(替换为您的仓库)


export BACKUPREPOURL=https://github.com/YOURUSERNAME/YOURBACKUP_REPO.git

或直接编辑脚本

nano scripts/backup.sh

4. 创建您的备份仓库

bash

为您的备份创建一个私有仓库

gh repo create YOUR_USERNAME/openclaw-backup --private --description OpenClaw工作区备份

备份内容

核心配置文件

  • - AGENTS.md - 工作流文档和流程
  • SOUL.md - 个人助手个性与行为
  • USER.md - 个人资料与偏好
  • MEMORY.md - 长期记忆与重要上下文
  • IDENTITY.md - 助手身份与表情符号
  • TOOLS.md - 工具配置与本地笔记
  • AUTOMATION.md - 定时任务与调度文档
  • openclaw.json - OpenClaw系统设置(令牌已脱敏以确保安全)

脚本与自动化

  • - scripts/ 目录 - 所有自动化脚本
  • memory/ 目录 - 每日记忆日志(最近30天)
  • 自定义配置文件

技能配置

  • - skills/ 目录 - 本地技能安装(仅元数据)
  • 技能自定义设置

仓库结构

文件在备份仓库中的组织方式如下:

/
├── config/ # 核心配置文件
├── scripts/ # 自动化脚本
├── memory/ # 每日记忆日志
├── skills/ # 技能配置
└── backup-info.md # 备份元数据

使用方法

首次设置:

bash scripts/setup.sh

定期备份:

bash scripts/backup.sh

选项:

bash scripts/backup.sh --force # 即使有冲突也强制推送 scripts/backup.sh --dry-run # 显示将要备份的内容

安全特性

  • - 自动令牌脱敏:所有敏感令牌(Discord、Telegram、API密钥)会自动被遮蔽
  • 推荐使用私有仓库:保持您的配置私密
  • 结构保留:所有设置均保留,仅敏感数据被遮蔽
  • 安全恢复:易于恢复并重新输入令牌

配置

编辑 scripts/backup.sh 中的以下变量:

bash

您的GitHub仓库URL


REPOURL=https://github.com/YOURUSERNAME/YOURBACKUPREPO.git

工作区目录(通常自动检测)

WORKSPACE_DIR=$HOME/.openclaw/workspace

手动备份

手动备份特定文件:
bash

克隆您的备份仓库


git clone https://github.com/YOURUSERNAME/YOURBACKUP_REPO.git /tmp/backup
cd /tmp/backup

复制重要文件

cp ~/.openclaw/workspace/AGENTS.md config/ cp ~/.openclaw/workspace/SOUL.md config/

... 等等

提交并推送

git add . git commit -m 手动备份 $(date) git push origin main

恢复流程

从备份中恢复:
bash

克隆备份


git clone https://github.com/YOURUSERNAME/YOURBACKUP_REPO.git

将文件复制回工作区

cp backup/config/* ~/.openclaw/workspace/ cp -r backup/scripts/* ~/.openclaw/workspace/scripts/

... 等等

在openclaw.json中重新输入您的实际令牌

nano ~/.openclaw/openclaw.json

故障排除

GitHub认证问题

bash

重新登录GitHub

gh auth logout gh auth login

权限被拒绝

bash

检查仓库是否存在以及您是否有访问权限

gh repo view YOURUSERNAME/YOURBACKUP_REPO

Git配置

bash

如有需要,设置git身份信息

git config --global user.name 您的姓名 git config --global user.email 您的邮箱@example.com

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 self-backup-1776180702 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 self-backup-1776180702 技能

通过命令行安装

skillhub install self-backup-1776180702

下载

⬇ 下载 self-backup v1.0.0(免费)

文件大小: 7.59 KB | 发布时间: 2026-4-15 11:29

v1.0.0 最新 2026-4-15 11:29
- Initial release of the self-backup skill for OpenClaw.
- Backs up key workspace files (configurations, scripts, skill metadata) to a configurable private GitHub repository.
- Includes automatic sanitization of sensitive tokens for security.
- Provides easy setup, restore, and manual/automated backup options.
- Supports customizable repository structure and backup content via configuration.
- Documentation covers setup, usage, restore process, and troubleshooting tips.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部