openclaw-backup
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseOpenClaw Backup Skill
OpenClaw 备份技能
Automated encrypted backup and restore for OpenClaw Agent workspace files using Claude Code.
借助Claude Code为OpenClaw Agent工作区文件提供自动化加密备份与恢复功能。
Overview
概述
This skill provides three core functions:
- Upload Backup - Encrypt and upload workspace files to soul-upload.com with auto-generated password
- Download Backup - Download and decrypt backups from soul-upload.com using stored password
- Delete Backup - Delete backups from remote storage
All backups use AES-256-CBC encryption (via openssl) with auto-generated random passwords. Each backup gets a unique password that is stored in the recovery file.
本技能提供三大核心功能:
- 上传备份 - 对工作区文件进行加密并上传至soul-upload.com,自动生成密码
- 下载备份 - 使用存储的密码从soul-upload.com下载并解密备份
- 删除备份 - 从远程存储中删除备份
所有备份均采用AES-256-CBC加密(通过openssl实现),并使用自动生成的随机密码。每个备份都有唯一的密码,该密码会存储在恢复文件中。
System Requirements
系统要求
Before executing backup operations, ensure the following tools are installed:
- Python 3.7+ (script runtime environment)
- requests library ()
pip install requests - tar (file archiving)
- openssl (encryption/decryption)
- curl (HTTP requests, system built-in)
执行备份操作前,请确保已安装以下工具:
- Python 3.7+(脚本运行环境)
- requests库(执行安装)
pip install requests - tar(文件归档工具)
- openssl(加密/解密工具)
- curl(HTTP请求工具,通常为系统内置)
Default Backup Files
默认备份文件
If the user doesn't specify files, the following OpenClaw workspace files are backed up by default:
- - Agent core identity and goals
SOUL.md - - Agent memory and context
MEMORY.md - - Agent identity definition
IDENTITY.md - - Agent configuration
AGENTS.md - - Tool configuration
TOOLS.md
如果用户未指定文件,默认备份以下OpenClaw工作区文件:
- - Agent核心身份与目标
SOUL.md - - Agent记忆与上下文
MEMORY.md - - Agent身份定义
IDENTITY.md - - Agent配置
AGENTS.md - - 工具配置
TOOLS.md
Workflow 1: Upload Backup
工作流1:上传备份
Trigger Scenarios
触发场景
Execute when the user requests to backup workspace files:
- "Back up my workspace files"
- "Upload SOUL.md to soul-upload"
- "Create an encrypted backup of my agent files"
- "Backup SOUL.md and MEMORY.md"
当用户请求备份工作区文件时执行:
- "备份我的工作区文件"
- "将SOUL.md上传至soul-upload"
- "为我的Agent文件创建加密备份"
- "备份SOUL.md和MEMORY.md"
Execution Steps
执行步骤
-
Collect File List
- If user specified files, use the user-specified files
- Otherwise, use default list:
SOUL.md MEMORY.md IDENTITY.md AGENTS.md TOOLS.md - Use Read tool to verify files exist
-
Execute Backup Script (Password Auto-Generated)
- Locate script path (usually in Skill directory)
scripts/backup.py - Execute command WITHOUT --password argument (script will auto-generate):
bash
python3 scripts/backup.py upload \ --files "SOUL.md MEMORY.md IDENTITY.md" - Script automatically generates a 32-character random password
- Capture stdout (JSON response) and stderr (progress info including generated password)
- Locate script path (usually
-
Process Response
- On success, script outputs JSON:
json
{ "backupId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "downloadUrl": "https://soul-upload.com/backup/...", "sizeBytes": 12345, "sha256": "abc123...", "password": "auto-generated-32-char-random-password" } - Parse JSON and extract key information including the auto-generated password
- On success, script outputs JSON:
-
Save Recovery Information
- Use Write tool to create/update
.openclaw-backup-recovery.txt - CRITICAL: Include the auto-generated password in the recovery file
- Format:
Backup ID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Password: auto-generated-32-char-random-password Download URL: https://soul-upload.com/backup/... Created: 2024-01-15 10:30:00 UTC Size: 12.05 KB SHA256: abc123... Files: SOUL.md, MEMORY.md, IDENTITY.md --- - Append to end of file (preserve history)
- Use Write tool to create/update
-
Display Success Message
- Inform user backup is complete
- Show Backup ID and file size
- IMPORTANT: Inform user that password was auto-generated and saved to
.openclaw-backup-recovery.txt - Warn user: Recovery file is CRITICAL - without it, backup cannot be restored
-
收集文件列表
- 如果用户指定了文件,使用用户指定的文件
- 否则,使用默认列表:
SOUL.md MEMORY.md IDENTITY.md AGENTS.md TOOLS.md - 使用读取工具验证文件是否存在
-
执行备份脚本(自动生成密码)
- 定位脚本路径(通常位于技能目录下的)
scripts/backup.py - 执行命令时无需添加参数(脚本会自动生成):
--passwordbashpython3 scripts/backup.py upload \ --files "SOUL.md MEMORY.md IDENTITY.md" - 脚本会自动生成一个32位的随机密码
- 捕获标准输出(JSON响应)和标准错误(包含生成密码的进度信息)
- 定位脚本路径(通常位于技能目录下的
-
处理响应
- 成功时,脚本输出如下JSON:
json
{ "backupId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "downloadUrl": "https://soul-upload.com/backup/...", "sizeBytes": 12345, "sha256": "abc123...", "password": "auto-generated-32-char-random-password" } - 解析JSON并提取关键信息,包括自动生成的密码
- 成功时,脚本输出如下JSON:
-
保存恢复信息
- 使用写入工具创建或更新
.openclaw-backup-recovery.txt - 重要提示:需将自动生成的密码包含在恢复文件中
- 格式如下:
备份ID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx 密码: auto-generated-32-char-random-password 下载链接: https://soul-upload.com/backup/... 创建时间: 2024-01-15 10:30:00 UTC 大小: 12.05 KB SHA256: abc123... 文件: SOUL.md, MEMORY.md, IDENTITY.md --- - 追加至文件末尾(保留历史记录)
- 使用写入工具创建或更新
-
显示成功消息
- 告知用户备份已完成
- 显示备份ID和文件大小
- 重点提醒:告知用户密码已自动生成并保存至
.openclaw-backup-recovery.txt - 警告用户:恢复文件至关重要 - 没有它,将无法恢复备份
Error Handling
错误处理
| Error Scenario | Detection | User Guidance |
|---|---|---|
| Files not found | Script returns error: "Files not found: ..." | List missing files, ask if user wants to continue backing up other files |
| Files too large | Script returns error: "Backup size ... exceeds limit ..." | Show actual size, suggest removing large files or splitting backup |
| Network error | Script returns error: "Network error: ..." | Suggest checking network connection, ask if retry is wanted |
| 413 Too Large | Script returns error: "File too large (413 Payload Too Large)" | Indicate 20MB limit exceeded, suggest reducing backup size |
| Encryption failed | Script returns error: "openssl encryption failed: ..." | Check if openssl is properly installed |
| 错误场景 | 检测方式 | 用户指引 |
|---|---|---|
| 文件未找到 | 脚本返回错误:"Files not found: ..." | 列出缺失的文件,询问用户是否要继续备份其他文件 |
| 文件过大 | 脚本返回错误:"Backup size ... exceeds limit ..." | 显示实际大小,建议移除大文件或拆分备份 |
| 网络错误 | 脚本返回错误:"Network error: ..." | 建议检查网络连接,询问是否需要重试 |
| 413 请求过大 | 脚本返回错误:"File too large (413 Payload Too Large)" | 提示超出20MB限制,建议减小备份大小 |
| 加密失败 | 脚本返回错误:"openssl encryption failed: ..." | 检查openssl是否正确安装 |
Example Conversation
对话示例
User: Back up my SOUL.md and MEMORY.md
Claude: I'll backup these files with auto-generated encryption.
[Executes backup script]
Backup complete!
- Backup ID: 3f8a2b1c-...
- Size: 45.2 KB
- Password: Auto-generated (32 chars)
- Recovery info saved to .openclaw-backup-recovery.txt
IMPORTANT: Keep .openclaw-backup-recovery.txt safe!
It contains the password needed to restore this backup.用户:备份我的SOUL.md和MEMORY.md
Claude:我将使用自动生成的加密方式备份这些文件。
[执行备份脚本]
备份完成!
- 备份ID: 3f8a2b1c-...
- 大小: 45.2 KB
- 密码: 自动生成(32位)
- 恢复信息已保存至.openclaw-backup-recovery.txt
重要提示:请妥善保管.openclaw-backup-recovery.txt!
它包含恢复此备份所需的密码。Workflow 2: Download Backup
工作流2:下载备份
Trigger Scenarios
触发场景
Execute when user requests to restore backup:
- "Restore my backup"
- "Download my last backup"
- "Recover backup [backup-id]"
- "Restore from [download-url]"
当用户请求恢复备份时执行:
- "恢复我的备份"
- "下载我最近的备份"
- "恢复备份[backup-id]"
- "从[download-url]恢复"
Execution Steps
执行步骤
-
Get Backup ID and Password
- Check if user provided Backup ID or Download URL
- If not provided, use Read tool to read
.openclaw-backup-recovery.txt - Extract latest Backup ID AND password from file
- If file doesn't exist or is empty, cannot proceed (password unknown)
-
Determine Output Directory
- Default: Current working directory ()
. - If user specified a directory, use user-specified directory
- Warn user: Existing files may be overwritten
- Default: Current working directory (
-
Execute Restore Script
- Execute command with password from recovery file:
bash
python3 scripts/backup.py download \ --backup-id "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ --password "password-from-recovery-file" \ --output-dir "." - Capture stdout (JSON response) and stderr (progress info)
- Execute command with password from recovery file:
-
Process Response
- On success, script outputs JSON:
json
{ "success": true, "extractedFiles": ["SOUL.md", "MEMORY.md", "IDENTITY.md"], "outputDir": "/path/to/output" } - Parse extracted file list
- On success, script outputs JSON:
-
Verify Restoration Result
- Use Read tool to read first few lines of restored files
- Show file preview for user to confirm content is correct
- Remind user to check complete content
-
Display Success Message
- List restored files
- Show output directory
- Suggest user verify file content
-
获取备份ID和密码
- 检查用户是否提供了备份ID或下载链接
- 如果未提供,使用读取工具读取
.openclaw-backup-recovery.txt - 从文件中提取最新的备份ID和密码
- 如果文件不存在或为空,则无法继续(密码未知)
-
确定输出目录
- 默认:当前工作目录()
. - 如果用户指定了目录,使用用户指定的目录
- 警告用户:现有文件可能会被覆盖
- 默认:当前工作目录(
-
执行恢复脚本
- 使用恢复文件中的密码执行命令:
bash
python3 scripts/backup.py download \ --backup-id "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ --password "password-from-recovery-file" \ --output-dir "." - 捕获标准输出(JSON响应)和标准错误(进度信息)
- 使用恢复文件中的密码执行命令:
-
处理响应
- 成功时,脚本输出如下JSON:
json
{ "success": true, "extractedFiles": ["SOUL.md", "MEMORY.md", "IDENTITY.md"], "outputDir": "/path/to/output" } - 解析提取的文件列表
- 成功时,脚本输出如下JSON:
-
验证恢复结果
- 使用读取工具读取恢复文件的前几行
- 向用户显示文件预览,确认内容正确
- 提醒用户检查完整内容
-
显示成功消息
- 列出恢复的文件
- 显示输出目录
- 建议用户验证文件内容
Error Handling
错误处理
| Error Scenario | Detection | User Guidance |
|---|---|---|
| Backup ID doesn't exist | Script returns error: "Backup not found: ..." | Check if Backup ID is correct, may have been deleted |
| Recovery file missing | | Cannot restore - password is unknown without recovery file |
| Wrong password | Script returns error: "Decryption failed - wrong password ..." | Recovery file may be corrupted or from different backup |
| Network error | Script returns error: "Network error: ..." | Suggest checking network connection, ask if retry is wanted |
| Extraction failed | Script returns error: "tar extraction failed: ..." | File may be corrupted, try downloading again |
| 错误场景 | 检测方式 | 用户指引 |
|---|---|---|
| 备份ID不存在 | 脚本返回错误:"Backup not found: ..." | 检查备份ID是否正确,可能已被删除 |
| 恢复文件缺失 | | 无法恢复 - 没有恢复文件则无法获取密码 |
| 密码错误 | 脚本返回错误:"Decryption failed - wrong password ..." | 恢复文件可能已损坏或来自其他备份 |
| 网络错误 | 脚本返回错误:"Network error: ..." | 建议检查网络连接,询问是否需要重试 |
| 解压失败 | 脚本返回错误:"tar extraction failed: ..." | 文件可能已损坏,建议重新下载 |
Example Conversation
对话示例
User: Restore my last backup
Claude: I found the most recent backup in .openclaw-backup-recovery.txt
- Backup ID: 3f8a2b1c-...
- Created: 2024-01-15 10:30:00 UTC
Downloading and decrypting backup...
Restoration complete! Extracted the following files:
- SOUL.md
- MEMORY.md
- IDENTITY.md
Files saved to current directory, please verify content is correct.用户:恢复我最近的备份
Claude:我在.openclaw-backup-recovery.txt中找到了最新备份
- 备份ID: 3f8a2b1c-...
- 创建时间: 2024-01-15 10:30:00 UTC
正在下载并解密备份...
恢复完成!已提取以下文件:
- SOUL.md
- MEMORY.md
- IDENTITY.md
文件已保存至当前目录,请验证内容是否正确。Workflow 3: Delete Backup
工作流3:删除备份
Trigger Scenarios
触发场景
Execute when user requests to delete remote backup:
- "Delete my backup"
- "Remove backup [backup-id]"
- "Delete the backup from soul-upload"
当用户请求删除远程备份时执行:
- "删除我的备份"
- "移除备份[backup-id]"
- "删除soul-upload上的备份"
Execution Steps
执行步骤
-
Get Backup ID
- Check if user provided Backup ID
- If not provided, use Read tool to read
.openclaw-backup-recovery.txt - Show available backup list for user to select
- If file doesn't exist or is empty, ask user to provide Backup ID
-
Request Confirmation
- Warning: This operation is irreversible, backup will be permanently deleted
- Show Backup ID to delete and creation time
- Ask user to confirm deletion
-
Execute Delete Script
- After user confirms, execute command:
bash
python3 scripts/backup.py delete \ --backup-id "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" - Capture stdout (JSON response) and stderr (progress info)
- After user confirms, execute command:
-
Process Response
- On success, script outputs JSON:
json
{ "success": true, "backupId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" }
- On success, script outputs JSON:
-
Update Recovery Info File
- Use Read tool to read
.openclaw-backup-recovery.txt - Remove deleted backup record (including its password)
- Use Write tool to save updated file
- If file becomes empty, can delete the file
- Use Read tool to read
-
Display Success Message
- Confirm backup was deleted
- Show deleted Backup ID
- Remind user: If backup is needed again, must create new one with new password
-
获取备份ID
- 检查用户是否提供了备份ID
- 如果未提供,使用读取工具读取
.openclaw-backup-recovery.txt - 显示可用备份列表供用户选择
- 如果文件不存在或为空,询问用户提供备份ID
-
请求确认
- 警告:此操作不可逆,备份将被永久删除
- 显示要删除的备份ID和创建时间
- 询问用户是否确认删除
-
执行删除脚本
- 用户确认后,执行命令:
bash
python3 scripts/backup.py delete \ --backup-id "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" - 捕获标准输出(JSON响应)和标准错误(进度信息)
- 用户确认后,执行命令:
-
处理响应
- 成功时,脚本输出如下JSON:
json
{ "success": true, "backupId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" }
- 成功时,脚本输出如下JSON:
-
更新恢复信息文件
- 使用读取工具读取
.openclaw-backup-recovery.txt - 删除已删除备份的记录(包括其密码)
- 使用写入工具保存更新后的文件
- 如果文件变为空,可以删除该文件
- 使用读取工具读取
-
显示成功消息
- 确认备份已删除
- 显示已删除的备份ID
- 提醒用户:如果需要再次备份,必须创建新的备份并使用新的自动生成密码
Error Handling
错误处理
| Error Scenario | Detection | User Guidance |
|---|---|---|
| Backup ID doesn't exist | Script returns error: "Backup not found: ..." | Backup may have been deleted or ID is incorrect |
| Network error | Script returns error: "Network error: ..." | Suggest checking network connection, ask if retry is wanted |
| User cancels | User declines confirmation | Operation cancelled, backup not deleted |
| 错误场景 | 检测方式 | 用户指引 |
|---|---|---|
| 备份ID不存在 | 脚本返回错误:"Backup not found: ..." | 备份可能已被删除或ID不正确 |
| 网络错误 | 脚本返回错误:"Network error: ..." | 建议检查网络连接,询问是否需要重试 |
| 用户取消 | 用户拒绝确认 | 操作已取消,备份未被删除 |
Example Conversation
对话示例
User: Delete my backup
Claude: I found the following backups in .openclaw-backup-recovery.txt:
1. Backup ID: 3f8a2b1c-... (2024-01-15 10:30:00)
2. Backup ID: 7b2c9d4e-... (2024-01-14 08:20:00)
Which backup would you like to delete? (1 or 2)
User: 1
Claude: Warning: This will permanently delete backup 3f8a2b1c-...
This action cannot be undone. Confirm deletion? (yes/no)
User: yes
Claude: Backup deleted.
- Backup ID: 3f8a2b1c-...
To backup again, create a new backup with a new auto-generated password.用户:删除我的备份
Claude:我在.openclaw-backup-recovery.txt中找到了以下备份:
1. 备份ID: 3f8a2b1c-...(2024-01-15 10:30:00)
2. 备份ID: 7b2c9d4e-...(2024-01-14 08:20:00)
你想要删除哪个备份?(1或2)
用户:1
Claude:警告:这将永久删除备份3f8a2b1c-...
此操作无法撤销。确认删除?(是/否)
用户:是
Claude:备份已删除。
- 备份ID: 3f8a2b1c-...
如果需要再次备份,请创建新的备份并使用新的自动生成密码。Security Notes
安全说明
Password Policy (NEW)
密码策略(新增)
- Auto-Generated Passwords: Each backup gets a unique 32-character random password
- Never Reuse Passwords: Per soul-upload.com policy, do NOT reuse passwords across backups
- Password Storage: Password is stored in (necessary for decryption)
.openclaw-backup-recovery.txt - User Responsibility: Users must keep recovery file safe - without it, backup cannot be restored
- 自动生成密码:每个备份都有唯一的32位随机密码
- 请勿重复使用密码:根据soul-upload.com政策,请勿在多个备份中重复使用密码
- 密码存储:密码存储在中(解密必需)
.openclaw-backup-recovery.txt - 用户责任:用户必须妥善保管恢复文件 - 没有它,无法恢复备份
Recovery File Security
恢复文件安全
- File Location: (workspace root directory)
.openclaw-backup-recovery.txt - Content: Backup ID, Password (CRITICAL), Download URL, timestamp, SHA256
- CRITICAL: Recovery file is the ONLY place password is stored
- Recommendation:
- Add to if sensitive
.gitignore - OR commit to version control for team access
- Consider backing up recovery file itself to separate secure location
- Add to
- 文件位置:(工作区根目录)
.openclaw-backup-recovery.txt - 内容:备份ID、密码(关键)、下载链接、时间戳、SHA256
- 关键提示:恢复文件是存储密码的唯一位置
- 建议:
- 如果敏感,添加至
.gitignore - 或提交至版本控制以供团队访问
- 考虑将恢复文件本身备份到单独的安全位置
- 如果敏感,添加至
Encryption Algorithm
加密算法
- Algorithm: AES-256-CBC (symmetric encryption)
- Salting: openssl automatically adds salt for enhanced security
- Compatibility: Consistent with soul-upload.com official documentation
- 算法:AES-256-CBC(对称加密)
- 加盐:openssl自动添加盐以增强安全性
- 兼容性:与soul-upload.com官方文档一致
Temporary File Cleanup
临时文件清理
- Script uses try-finally to ensure temporary files are cleaned up
- Avoids leaving unencrypted sensitive data on disk
- 脚本使用try-finally确保临时文件被清理
- 避免在磁盘上留下未加密的敏感数据
File Size Limits
文件大小限制
- Maximum Backup Size: 20 MB (compressed and encrypted)
- Check Timing: Automatically checked before upload
- Limit Exceeded Handling: Show actual size, suggest user:
- Remove large files (like logs, caches)
- Split backup (backup different files in batches)
- 最大备份大小:20 MB(压缩并加密后)
- 检查时机:上传前自动检查
- 超出限制处理:显示实际大小,建议用户:
- 移除大文件(如日志、缓存)
- 拆分备份(分批备份不同文件)
API Reference
API参考
soul-upload.com Backup API:
| Endpoint | Method | Function | Response |
|---|---|---|---|
| POST | Upload backup | |
| GET | Download backup | 302 redirect to R2 storage URL |
| DELETE | Delete backup | |
Common Status Codes:
- 200 - Success
- 404 - Backup not found
- 413 - File too large (exceeds 20MB)
- 415 - Unsupported file type
- 500 - Server error
soul-upload.com备份API:
| 端点 | 方法 | 功能 | 响应 |
|---|---|---|---|
| POST | 上传备份 | |
| GET | 下载备份 | 302重定向至R2存储URL |
| DELETE | 删除备份 | |
常见状态码:
- 200 - 成功
- 404 - 备份未找到
- 413 - 文件过大(超过20MB)
- 415 - 不支持的文件类型
- 500 - 服务器错误
Troubleshooting
故障排除
Missing Dependencies
依赖缺失
Problem: Script error "Missing required tools: tar, openssl"
Solution:
- macOS: (tar built-in)
brew install openssl - Ubuntu/Debian:
sudo apt-get install tar openssl - Verify installation: and
tar --versionopenssl version
问题:脚本错误 "Missing required tools: tar, openssl"
解决方案:
- macOS: (tar为系统内置)
brew install openssl - Ubuntu/Debian:
sudo apt-get install tar openssl - 验证安装:和
tar --versionopenssl version
Python requests Library Missing
Python requests库缺失
Problem: Script error "Error: 'requests' library not found"
Solution:
bash
pip install requests问题:脚本错误 "Error: 'requests' library not found"
解决方案:
bash
pip install requestsor
或
pip3 install requests
undefinedpip3 install requests
undefinedRecovery File Lost
恢复文件丢失
Problem: Cannot restore backup - recovery file missing
Solution:
- Recovery file is CRITICAL - contains the only copy of the password
- Without recovery file, backup CANNOT be restored
- Recommend backing up recovery file to separate secure location
- If lost, backup is permanently inaccessible
问题:无法恢复备份 - 恢复文件缺失
解决方案:
- 恢复文件至关重要 - 包含唯一的密码副本
- 没有恢复文件,备份将无法恢复
- 建议将恢复文件单独备份到安全位置
Network Timeout
网络超时
Problem: Timeout during upload/download
Solution:
- Check network connection
- Reduce backup file size (remove unnecessary files)
- Script default timeout is 5 minutes, usually sufficient
问题:上传/下载时超时
解决方案:
- 检查网络连接
- 减小备份文件大小(移除不必要的文件)
- 脚本默认超时为5分钟,通常足够使用
File Already Exists
文件已存在
Problem: Overwriting existing files during restore
Solution:
- Backup existing files before restore
- Specify different output directory
- Manually move existing files to other location
问题:恢复时覆盖现有文件
解决方案:
- 恢复前备份现有文件
- 指定不同的输出目录
- 手动将现有文件移动到其他位置
Usage Examples
使用示例
Example 1: Backup All Default Files
示例1:备份所有默认文件
User: Back up my workspace files
Claude: [Execute upload workflow using default file list]
[Auto-generate password and save to recovery file]用户:备份我的工作区文件
Claude:[使用默认文件列表执行上传工作流]
[自动生成密码并保存至恢复文件]Example 2: Backup Specific Files
示例2:备份指定文件
User: Back up only SOUL.md and MEMORY.md
Claude: [Execute upload workflow, backup only specified files]
[Auto-generate password and save to recovery file]用户:仅备份SOUL.md和MEMORY.md
Claude:[执行上传工作流,仅备份指定文件]
[自动生成密码并保存至恢复文件]Example 3: Restore Latest Backup
示例3:恢复最新备份
User: Restore my last backup
Claude: [Read latest Backup ID and password from .openclaw-backup-recovery.txt]
[Execute download workflow]用户:恢复我最近的备份
Claude:[从.openclaw-backup-recovery.txt读取最新备份ID和密码]
[执行下载工作流]Example 4: Restore Specific Backup
示例4:恢复指定备份
User: Restore backup 3f8a2b1c-1234-5678-90ab-cdef12345678
Claude: [Read password for this Backup ID from recovery file]
[Execute download workflow]用户:恢复备份3f8a2b1c-1234-5678-90ab-cdef12345678
Claude:[从恢复文件中读取此备份ID的密码]
[执行下载工作流]Example 5: Delete Old Backups
示例5:删除旧备份
User: Delete my old backups
Claude: [Show available backup list from recovery file]
[User selects backup to delete]
[Execute delete workflow]
[Remove entry from recovery file]用户:删除我的旧备份
Claude:[从恢复文件中显示可用备份列表]
[用户选择要删除的备份]
[执行删除工作流]
[从恢复文件中删除条目]Best Practices
最佳实践
- Regular Backups: Recommend weekly backups or after important changes
- Recovery File Management: Keep safe and backed up separately
.openclaw-backup-recovery.txt - Verify Restoration: Regularly test backup restoration process to ensure backups are usable
- Clean Old Backups: Regularly delete unneeded old backups to save storage space
- Multiple Copies: Consider keeping recovery file in multiple secure locations
- 定期备份:建议每周备份或在重要更改后备份
- 恢复文件管理:妥善保管并单独备份
.openclaw-backup-recovery.txt - 验证恢复:定期测试备份恢复过程,确保备份可用
- 清理旧备份:定期删除不需要的旧备份以节省存储空间
- 多副本:考虑将恢复文件保存在多个安全位置
Script Path
脚本路径
Script file is located in Skill directory at .
scripts/backup.pyWhen executing Bash commands, ensure correct relative or absolute path is used. Usually:
- If currently in Skill directory:
python3 scripts/backup.py ... - If in other directory: Use absolute path or to Skill directory first
cd
脚本文件位于技能目录下的。
scripts/backup.py执行Bash命令时,请确保使用正确的相对或绝对路径。通常:
- 如果当前在技能目录中:
python3 scripts/backup.py ... - 如果在其他目录中:使用绝对路径或先到技能目录
cd
Reference Documentation
参考文档
Version: 2.0.0
Author: Claude Code
License: MIT
Password Policy: Auto-generated unique password per backup (NEW in v2.0.0)
版本: 2.0.0
作者: Claude Code
许可证: MIT
密码策略: 每次备份自动生成唯一密码(v2.0.0新增)