← 返回
未分类 Key 中文

Backup 2 Github

Backup personalized OpenClaw configuration and user data to a GitHub repo with single-commit history and optional dry-run preview.
备份OpenClaw个性化配置和用户数据到GitHub仓库,支持单次提交历史记录和可选的预览功能。
fangbb-coder
未分类 clawhub v1.0.1 1 版本 100000 Key: 需要
★ 0
Stars
📥 635
下载
💾 0
安装
1
版本
#backup#github#latest#restore

概述

Backup to GitHub

OpenClaw skill to backup personalized configuration and user data to a GitHub repository. Ensures easy migration and disaster recovery.

Features

  • ✅ Backup only personalized files (not default OpenClaw)
  • ✅ Restore to fresh installation with identical state
  • ✅ Supports GitHub via Personal Access Token
  • ✅ Single-commit backup (clean history)
  • ✅ Dry-run mode to preview changes

What Gets Backed Up

This skill backs up files that are specific to your setup, excluding default OpenClaw installation files:

  • Core Configuration: openclaw.json (TTS, skills, plugins settings)
  • Long-term Memory: MEMORY.md (curated memories, learned context)
  • User Identity: USER.md, IDENTITY.md, SOUL.md (your profile & persona)
  • Custom Tools: TOOLS.md (camera names, SSH hosts, voice preferences, etc.)
  • Heartbeat Tasks: HEARTBEAT.md (periodic checklists)
  • Scheduled Jobs: cron/jobs.json (your cron task configuration)
  • Monitoring Panel: Custom monitor scripts (openclaw-monitor.cjs, monitor/*.cjs)
  • Skill Configurations: Selected skill config files (YAML, README, SKILL.md) for skills you've customized (edit backup.py to add paths)
  • Custom Scripts: Any user-created scripts (edit backup.py to add paths)
  • Credentials (optional): credentials/*.json (Xiaohongshu cookies, etc.) - configurable

Automatically Excluded:

  • Default/standard skills from the library
  • Daily memory files (memory/YYYY-MM-DD.md) - too large/ephemeral
  • Cron run logs (cron/runs/)
  • Temporary files, caches, .git, __pycache__, venv, node_modules
  • Large model files and binaries

Prerequisites

  • GitHub account with Personal Access Token (repo scope)
  • Backup repository (private recommended)

Setup

# Install dependencies
pip install -r requirements.txt

# Configure (create .env file)
GITHUB_TOKEN=ghp_your_token_here
GITHUB_REPO=your-username/your-backup-repo

Usage

# Backup current configuration
python backup.py --action backup

# Preview what will be backed up (no push)
python backup.py --action backup --dry-run

# Restore from backup (overwrites existing files)
python backup.py --action restore

How It Works

Backup

  1. Scans predefined file list (in backup.pyBACKUP_FILES)
  2. Filters out excluded patterns
  3. Creates a single commit on the default branch with all file changes
  4. Pushes to your GitHub repository

Restore

  1. Fetches the latest backup commit
  2. Downloads each file to its original location
  3. Reports success and suggests service restarts

Customization

Edit BACKUP_FILES in backup.py to add or remove files from backup.

Security Notes

  • GitHub Token should have minimal scope (repo only)
  • Store token in .env (never commit)
  • Use a private repository for backups
  • Credentials (e.g., Xiaohongshu cookies) are optional and clearly marked

Limitations

  • Does not backup large binary files (ML models, caches, datasets)
  • Does not backup running state (processes, logs)
  • Daily memory files excluded by design (too large, ephemeral)
  • Requires internet access for GitHub operations

Troubleshooting

Error: GITHUB_TOKEN not set

→ Set token in .env or use --token flag.

Error: Repository not found

→ Check GITHUB_REPO format: owner/repo.

File not backing up

→ Ensure path is in BACKUP_FILES and not excluded by patterns.

License

MIT

版本历史

共 1 个版本

  • v1.0.1 当前
    2026-05-02 11:50 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

Voice Bridge Light

fangbb-coder
提供兼容OpenAI接口的轻量级本地STT(Whisper)和TTS(Edge TTS/Piper)语音桥接HTTP服务。
★ 0 📥 554

connect-to-another-openclaw

fangbb-coder
远程连接并管理另一台 OpenClaw 服务器,检查状态、同步技能、重启网关、监控频道。
★ 0 📥 371

deerflow-install-master

fangbb-coder
DeerFlow 2.0 一键安装与配置技能。基于实际部署经验(2026‑03‑29),覆盖从仓库下载到成功运行的全流程,含避坑指南。适用场景:(1) 在 OpenClaw 环境安装 DeerFlow 2.0;(2) 快速排查安装问题;(3
★ 1 📥 667