返回顶部
w

workspace-backup工作区备份

Automated workspace backup to GitHub — git-based with auto-generated commit messages, proper .gitignore, and restore procedures. Cron-friendly for hands-free backup. Use for backing up your OpenClaw workspace, skills, memory, and configuration.

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

workspace-backup

💾 工作区备份

基于Git的OpenClaw工作区自动备份工具,可备份至GitHub。设计为定时任务或按需运行。

功能特性

  • - 一键备份,自动生成提交信息
  • 针对OpenClaw工作区的智能.gitignore配置
  • 提交中包含时间戳及变更文件摘要
  • 支持从任意历史节点恢复
  • 兼容定时任务(无需终端交互)

配置指南

1. 初始化备份仓库

bash
cd ~/.openclaw/workspace
git init
git remote add origin git@github.com:YOURUSER/YOURREPO.git

2. 确保SSH密钥已配置

脚本使用SSH协议推送代码。请确保部署密钥或SSH密钥可用。

3. 执行备份

bash
bash {baseDir}/scripts/backup.sh

4. 设置定时任务

在OpenClaw中创建定时任务:

json
{
name: workspace-backup,
schedule: 0 /6 ,
command: bash /home/node/.openclaw/workspace/skills/workspace-backup/{baseDir}/scripts/backup.sh,
description: 每6小时备份工作区至GitHub
}

或通过系统crontab配置:

0 /6 cd /home/node/.openclaw/workspace && bash skills/workspace-backup/{baseDir}/scripts/backup.sh >> /tmp/backup.log 2>&1

恢复操作

恢复整个工作区至最新备份

bash cd ~/.openclaw/workspace git fetch origin git reset --hard origin/main

从历史记录恢复特定文件

bash git log --oneline -- path/to/file # 查找提交记录 git checkout -- path/to/file # 恢复文件

恢复到特定时间点

bash git log --oneline --before=2026-02-01 # 查找该日期附近的提交 git checkout # 进入分离头指针状态

复制所需内容,然后执行:git checkout main

查看备份间的变更内容

bash git log --oneline -10 git diff --stat

.gitignore配置

备份脚本会自动创建.gitignore文件(若不存在),排除以下内容:

  • - .venv/ — Python虚拟环境
  • .data/ — 本地数据库及数据文件
  • .env — 敏感环境变量
  • nodemodules/ — Node.js依赖
  • pycache/ — Python字节码缓存
  • *.pyc — 编译后的Python文件
  • .DSStore — macOS元数据

脚本参考

脚本说明
{baseDir}/scripts/backup.sh主备份脚本 — 添加、提交、推送

致谢

M. Abidi 构建 | agxntsix.ai YouTube | GitHub 属于 AgxntSix技能套件 的一部分,专为OpenClaw代理设计。

📅 需要为您的企业配置OpenClaw? 预约免费咨询

标签

skill ai

通过对话安装

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

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 workspace-backup-1776192263 技能

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

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

通过命令行安装

skillhub install workspace-backup-1776192263

下载

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

文件大小: 3.19 KB | 发布时间: 2026-4-15 13:40

v1.0.0 最新 2026-4-15 13:40
- Initial release of workspace-backup skill.
- Automates backups of OpenClaw workspaces to GitHub with git-based versioning.
- Features auto-generated commit messages, smart .gitignore handling, and timestamped change tracking.
- Supports full or partial workspace restore from any backup point.
- Designed to run hands-free as a cron job or on-demand.
- Requires Git and GitHub SSH access for operation.

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

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

p2p_official_large
返回顶部