{"skill":{"slug":"openclaw-github-backup","displayName":"OpenClaw GitHub Backup","summary":"Automatically backup OpenClaw configuration to a private GitHub repository. Features API key sanitization, activity detection, and smart backup frequency (ho...","description":"---\nname: openclaw-backup\ndescription: Automatically backup OpenClaw configuration to a private GitHub repository. Features API key sanitization, activity detection, and smart backup frequency (hourly when active, daily when inactive). One-click recovery support.\n---\n\n# OpenClaw Backup\n\n## Overview\n\nAutomatically backup your complete OpenClaw configuration to a private GitHub repository. Features:\n\n- 🔐 **API Key Sanitization** - Automatically replaces sensitive keys before committing\n- 🔄 **Smart Backup Frequency** - Hourly when active, daily when inactive\n- 📦 **Complete Backup** - Agents, extensions, workspace, memory, and more\n- 🔧 **One-Click Recovery** - Comprehensive recovery guide included\n\n## When to Use\n\n- After initial OpenClaw setup, establish a backup mechanism\n- Periodic backup status checks\n- System migration or disaster recovery\n\n## Quick Start\n\n### 1. Prerequisites\n\n- Git installed\n- GitHub SSH Key configured (recommended) or Personal Access Token\n- GitHub private repository created (e.g., `openclaw-backup`)\n\n### 2. Install Skill\n\nCopy this skill to your OpenClaw workspace:\n\n```bash\n# Ensure skills directory exists\nmkdir -p ~/.openclaw/workspace/skills\n\n# Copy skill (assuming downloaded to current directory)\ncp -r openclaw-backup ~/.openclaw/workspace/skills/\n```\n\n### 3. Run Installation Script\n\n```bash\n# One-click configuration\nbash ~/.openclaw/workspace/skills/openclaw-backup/scripts/install.sh\n```\n\nFollow the prompts to enter:\n- GitHub repository URL (e.g., `git@github.com:yourname/openclaw-backup.git`)\n- Git username and email\n\n### 4. Configure Auto Backup\n\nAfter installation, a cron job will be created in OpenClaw to check for backup needs every hour.\n\n## Usage\n\n### Manual Backup\n\n```bash\n~/.openclaw/backup.sh backup\n```\n\n### Auto Backup (Based on Activity)\n\n```bash\n~/.openclaw/backup.sh auto\n```\n\n### Check Activity Status\n\n```bash\n~/.openclaw/check-activity.sh\n# Output: active or inactive\n```\n\n### Restore from Backup\n\n```bash\n~/.openclaw/backup.sh restore\n```\n\nFollow the prompts:\n1. Clone the backup repository\n2. Edit `openclaw.json` to fill in real API keys\n3. Restart Gateway\n\n## Backup Contents\n\n| Included | Description |\n|----------|-------------|\n| ✅ openclaw.json | Main configuration (API keys sanitized) |\n| ✅ agents/ | All agent session history |\n| ✅ extensions/ | All plugins |\n| ✅ workspace-*/ | Agent workspaces |\n| ✅ memory/ | Agent memory databases |\n| ✅ credentials/ | Credential configurations |\n| ✅ feishu/ | Feishu configurations |\n| ✅ wecom/ | WeChat Work configurations |\n\n| Excluded | Reason |\n|----------|--------|\n| ❌ logs/ | Log files, can be regenerated |\n\n## Smart Backup Strategy\n\n| Status | Condition | Backup Frequency |\n|--------|-----------|------------------|\n| 🟢 Active | Activity within last hour | Every 1 hour |\n| 🔴 Inactive | No new activity | Every 24 hours |\n\n## Security Notes\n\n⚠️ **Important Security Warnings**:\n\n1. **Must use a private repository** - Backups contain sensitive configurations\n2. **API Keys are sanitized** - But other configs may still contain sensitive info\n3. **Manual API key entry required on restore** - Keys are replaced in backup files\n\n## File Structure\n\n```\n~/.openclaw/\n├── backup.sh              # Main backup script\n├── check-activity.sh      # Activity status checker\n├── .gitignore             # Git ignore configuration\n└── workspace/\n    └── memory/\n        └── heartbeat-state.json  # Records backup state\n```\n\n## Troubleshooting\n\n### Push Failed\n\n```bash\n# Check SSH connection\nssh -T git@github.com\n\n# Force push (use with caution)\ncd ~/.openclaw && git push origin main --force\n```\n\n### Configuration Lost After Restore\n\nEnsure:\n1. Edit `openclaw.json` to fill in real API keys\n2. Restart Gateway: `openclaw gateway restart`\n\n## Customization\n\n### Custom Backup Frequency\n\nEdit `heartbeat-state.json`:\n\n```json\n{\n  \"backup\": {\n    \"activeInterval\": 3600000,\n    \"inactiveInterval\": 86400000\n  }\n}\n```\n\n### Add More Exclusions\n\nEdit `~/.openclaw/.gitignore`:\n\n```gitignore\n# Custom exclusions\nsecrets/\n*.pem\n```\n\n## Author\n\nOpenClaw Community\n\n## Version\n\n- v1.0.0 - Initial release with auto backup and smart frequency","topics":["Backup","GitHub","Repository"],"tags":{"latest":"1.0.0"},"stats":{"comments":0,"downloads":639,"installsAllTime":24,"installsCurrent":1,"stars":0,"versions":1},"createdAt":1773461789475,"updatedAt":1779078178634},"latestVersion":{"version":"1.0.0","createdAt":1773461789475,"changelog":"Initial release: Auto backup OpenClaw to GitHub with smart frequency","license":"MIT-0"},"metadata":null,"owner":{"handle":"wang5sheng","userId":"s179f47xyhpddmd37qbg85b7mn845bsp","displayName":"wang5sheng","image":"https://avatars.githubusercontent.com/u/174398358?v=4"},"moderation":{"isSuspicious":false,"isMalwareBlocked":false,"verdict":"clean","reasonCodes":["review.llm_review"],"summary":"Review: review.llm_review","engineVersion":"v2.4.24","updatedAt":1780089877515}}