This skill helps you automatically back up OpenClaw's core configuration, skill source code, and memory data to the mounted TOS cloud drive, creating backup directories by date and automatically skipping dependency directories and large executable files.
When to Use
Use this skill when the user requests the following operations:
- "Back up OpenClaw configuration"
- "Back up skill files"
- "Back up to cloud drive"
- "Create system backup"
- "Scheduled backup"
Backup Policy
Backup Content
- Core configuration files: All MD documents in the workspace root directory (AGENTS.md, SOUL.md, USER.md, etc.)
- System configuration:
/root/.openclaw/config/Configuration files such as JSON/YAML/ENV/conf in the directory, skipping binary files - Skill files: Source files of extended skills and workspace skills (JS/TS/PY/MD/JSON/YAML/SH), automatically skipping the following directories:
node_modules/venv/__pycache__/dist/build/
- Memory data:
/root/.openclaw/workspace/memory/All memory files in the directory
Storage Structure
my-bucket/
└── openclaw_backup/
├── 2026-03-11/
│ ├── *.md # 核心配置文件
│ ├── config/ # 系统配置
│ ├── skills/
│ │ ├── extensions/ # 扩展技能源码
│ │ └── workspace/ # 工作区技能源码
│ ├── memory/ # 记忆数据
│ ├── backup_summary.txt # 备份统计信息
│ └── backup_manifest.txt # 完整文件清单
└── 2026-03-12/
└── ...
Instructions
1. Perform a full backup
Run the backup script to automatically complete all backup operations:
scripts/backup.sh
Example output:
🔍 检测可用网盘...
✅ 自动选择存储桶: my-bucket (/root/.openclaw/workspace/my-bucket)
ℹ️ 所有可用存储桶:
- my-bucket: /root/.openclaw/workspace/my-bucket
💡 如需固定使用某个存储桶,请运行: bash scripts/config.sh <存储桶名称>
📂 创建备份目录: /root/.openclaw/workspace/my-bucket/openclaw_backup/2026-03-11
📝 备份核心配置文件 (MD文档)...
✅ 核心配置文件备份完成 (7 个文件)
⚙️ 备份系统配置 (仅配置文件,跳过二进制)...
🔍 扫描系统配置子目录...
✅ 备份目录: agents (大小: 228K, 文件数: 5)
✅ 备份目录: canvas (大小: 8.0K, 文件数: 1)
✅ 备份目录: completions (大小: 460K, 文件数: 4)
✅ 备份目录: cron (大小: 12K, 文件数: 2)
⚠️ 跳过目录: extensions (大小: 2.4G, 文件数: 67554 - 超过阈值)
✅ 备份目录: identity (大小: 8.0K, 文件数: 1)
⚠️ 跳过目录: logs (排除列表)
✅ 备份目录: memory (大小: 44K, 文件数: 5)
⚠️ 跳过目录: workspace (排除列表)
✅ 系统配置备份完成 (21 个文件)
🔧 备份技能文件 (仅源码文件,跳过node_modules等依赖目录)...
✅ 技能文件备份完成
🧠 备份记忆数据...
ℹ️ 记忆目录不存在,跳过记忆数据备份
✅ 记忆数据备份完成
📊 生成备份统计...
✅ 备份完成!
📦 备份桶: my-bucket
📂 备份路径: openclaw_backup/2026-03-11
📄 备份文件数: 463
💾 总大小: 3.6M
📋 备份摘要已保存到: backup_summary.txt
📑 完整文件清单已保存到: backup_manifest.txt
2. Configure the default storage bucket
Always use a specific storage bucket for backups:
scripts/config.sh <存储桶名称>
Example:
scripts/config.sh my-bucket
3. Check backup history
List all created backups:
scripts/list_backups.sh
Example output:
📋 现有备份列表 (存储桶: my-bucket):
=====================================
📅 2026-03-11 (463 files, 3.6M)
📅 2026-03-10 (452 files, 3.4M)
📅 2026-03-09 (441 files, 3.2M)
4. Restore backup
Restore the system from a backup of a specified date:
scripts/restore.sh <备份日期>
Preview restore (without actually modifying files):
scripts/restore.sh 2026-03-11 --dry-run
Example output:
✅ 自动选择存储桶: my-bucket (/root/.openclaw/workspace/my-bucket)
📂 准备恢复备份: 2026-03-11
📦 存储桶: my-bucket
📂 备份路径: /root/.openclaw/workspace/my-bucket/openclaw_backup/2026-03-11
⚠️ 恢复操作会覆盖现有文件,确定要继续吗? (y/N) y
🔄 开始恢复...
📝 恢复核心配置文件...
⚙️ 恢复系统配置...
✅ 系统配置恢复完成
🔧 恢复技能文件...
✅ 技能文件恢复完成
🧠 恢复记忆数据...
✅ 记忆数据恢复完成
✅ 恢复完成!
📅 恢复的备份日期: 2026-03-11
⚠️ 建议重启OpenClaw服务以应用所有配置
3. Feedback format
Use the following format when reporting backup results to the user:
"✅ The backup has been completed successfully!
📦 Backup details
- Storage bucket: my-bucket
- Backup path:
openclaw_backup/2026-03-11/- Number of backup files: 15,076
- Total size: 922 MB
📋 Backup content includes:
- Core configuration files (all MD documents in the workspace)
- System configuration (configuration files such as JSON/YAML/ENV, skipping binary files)
- Skill source code (source files such as JS/TS/PY/MD, automatically skipping dependency directories)
- Memory data"
Notes
- Automatically detect the mounted cloud drive; by default, use the first detected storage bucket
- If no cloud drive is detected, prompt the user to configure a TOS storage bucket in the arkClaw interface
- Automatically skip executable files, dependency directories, and large binary files
- Each backup automatically creates a new date directory and will not overwrite historical backups