← 返回
开发者工具 Key 中文

OpenClaw GitHub Backup

Automatically backup OpenClaw configuration to a private GitHub repository. Features API key sanitization, activity detection, and smart backup frequency (ho...
自动备份 OpenClaw 配置到私有 GitHub 仓库,支持 API 密钥脱敏、活动检测和智能备份频率。
wang5sheng
开发者工具 clawhub v1.0.0 1 版本 100000 Key: 需要
★ 0
Stars
📥 590
下载
💾 12
安装
1
版本
#latest

概述

OpenClaw Backup

Overview

Automatically backup your complete OpenClaw configuration to a private GitHub repository. Features:

  • 🔐 API Key Sanitization - Automatically replaces sensitive keys before committing
  • 🔄 Smart Backup Frequency - Hourly when active, daily when inactive
  • 📦 Complete Backup - Agents, extensions, workspace, memory, and more
  • 🔧 One-Click Recovery - Comprehensive recovery guide included

When to Use

  • After initial OpenClaw setup, establish a backup mechanism
  • Periodic backup status checks
  • System migration or disaster recovery

Quick Start

1. Prerequisites

  • Git installed
  • GitHub SSH Key configured (recommended) or Personal Access Token
  • GitHub private repository created (e.g., openclaw-backup)

2. Install Skill

Copy this skill to your OpenClaw workspace:

# Ensure skills directory exists
mkdir -p ~/.openclaw/workspace/skills

# Copy skill (assuming downloaded to current directory)
cp -r openclaw-backup ~/.openclaw/workspace/skills/

3. Run Installation Script

# One-click configuration
bash ~/.openclaw/workspace/skills/openclaw-backup/scripts/install.sh

Follow the prompts to enter:

  • GitHub repository URL (e.g., git@github.com:yourname/openclaw-backup.git)
  • Git username and email

4. Configure Auto Backup

After installation, a cron job will be created in OpenClaw to check for backup needs every hour.

Usage

Manual Backup

~/.openclaw/backup.sh backup

Auto Backup (Based on Activity)

~/.openclaw/backup.sh auto

Check Activity Status

~/.openclaw/check-activity.sh
# Output: active or inactive

Restore from Backup

~/.openclaw/backup.sh restore

Follow the prompts:

  1. Clone the backup repository
  2. Edit openclaw.json to fill in real API keys
  3. Restart Gateway

Backup Contents

IncludedDescription
-----------------------
✅ openclaw.jsonMain configuration (API keys sanitized)
✅ agents/All agent session history
✅ extensions/All plugins
✅ workspace-*/Agent workspaces
✅ memory/Agent memory databases
✅ credentials/Credential configurations
✅ feishu/Feishu configurations
✅ wecom/WeChat Work configurations
ExcludedReason
------------------
❌ logs/Log files, can be regenerated

Smart Backup Strategy

StatusConditionBackup Frequency
-------------------------------------
🟢 ActiveActivity within last hourEvery 1 hour
🔴 InactiveNo new activityEvery 24 hours

Security Notes

⚠️ Important Security Warnings:

  1. Must use a private repository - Backups contain sensitive configurations
  2. API Keys are sanitized - But other configs may still contain sensitive info
  3. Manual API key entry required on restore - Keys are replaced in backup files

File Structure

~/.openclaw/
├── backup.sh              # Main backup script
├── check-activity.sh      # Activity status checker
├── .gitignore             # Git ignore configuration
└── workspace/
    └── memory/
        └── heartbeat-state.json  # Records backup state

Troubleshooting

Push Failed

# Check SSH connection
ssh -T git@github.com

# Force push (use with caution)
cd ~/.openclaw && git push origin main --force

Configuration Lost After Restore

Ensure:

  1. Edit openclaw.json to fill in real API keys
  2. Restart Gateway: openclaw gateway restart

Customization

Custom Backup Frequency

Edit heartbeat-state.json:

{
  "backup": {
    "activeInterval": 3600000,
    "inactiveInterval": 86400000
  }
}

Add More Exclusions

Edit ~/.openclaw/.gitignore:

# Custom exclusions
secrets/
*.pem

Author

OpenClaw Community

Version

  • v1.0.0 - Initial release with auto backup and smart frequency

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-19 21:20 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

developer-tools

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 68 📥 180,474
developer-tools

Gog

steipete
Google Workspace 命令行工具,支持 Gmail、日历、云端硬盘、通讯录、表格和文档。
★ 921 📥 185,927
developer-tools

Agent Browser

matrixy
专为AI智能体优化的无头浏览器自动化CLI,支持无障碍树快照和基于引用的元素选择。
★ 427 📥 118,386