openclaw-backup

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

OpenClaw 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:
  1. Upload Backup - Encrypt and upload workspace files to soul-upload.com with auto-generated password
  2. Download Backup - Download and decrypt backups from soul-upload.com using stored password
  3. 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.
本技能提供三大核心功能:
  1. 上传备份 - 对工作区文件进行加密并上传至soul-upload.com,自动生成密码
  2. 下载备份 - 使用存储的密码从soul-upload.com下载并解密备份
  3. 删除备份 - 从远程存储中删除备份
所有备份均采用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:
  • SOUL.md
    - Agent core identity and goals
  • MEMORY.md
    - Agent memory and context
  • IDENTITY.md
    - Agent identity definition
  • AGENTS.md
    - Agent configuration
  • TOOLS.md
    - Tool configuration
如果用户未指定文件,默认备份以下OpenClaw工作区文件:
  • SOUL.md
    - Agent核心身份与目标
  • MEMORY.md
    - Agent记忆与上下文
  • IDENTITY.md
    - Agent身份定义
  • AGENTS.md
    - Agent配置
  • 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

执行步骤

  1. 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
  2. Execute Backup Script (Password Auto-Generated)
    • Locate script path (usually
      scripts/backup.py
      in Skill directory)
    • 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)
  3. 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
  4. 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)
  5. 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
  1. 收集文件列表
    • 如果用户指定了文件,使用用户指定的文件
    • 否则,使用默认列表:
      SOUL.md MEMORY.md IDENTITY.md AGENTS.md TOOLS.md
    • 使用读取工具验证文件是否存在
  2. 执行备份脚本(自动生成密码)
    • 定位脚本路径(通常位于技能目录下的
      scripts/backup.py
    • 执行命令时无需添加
      --password
      参数(脚本会自动生成):
      bash
      python3 scripts/backup.py upload \
        --files "SOUL.md MEMORY.md IDENTITY.md"
    • 脚本会自动生成一个32位的随机密码
    • 捕获标准输出(JSON响应)和标准错误(包含生成密码的进度信息)
  3. 处理响应
    • 成功时,脚本输出如下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并提取关键信息,包括自动生成的密码
  4. 保存恢复信息
    • 使用写入工具创建或更新
      .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
      ---
    • 追加至文件末尾(保留历史记录)
  5. 显示成功消息
    • 告知用户备份已完成
    • 显示备份ID和文件大小
    • 重点提醒:告知用户密码已自动生成并保存至
      .openclaw-backup-recovery.txt
    • 警告用户:恢复文件至关重要 - 没有它,将无法恢复备份

Error Handling

错误处理

Error ScenarioDetectionUser Guidance
Files not foundScript returns error: "Files not found: ..."List missing files, ask if user wants to continue backing up other files
Files too largeScript returns error: "Backup size ... exceeds limit ..."Show actual size, suggest removing large files or splitting backup
Network errorScript returns error: "Network error: ..."Suggest checking network connection, ask if retry is wanted
413 Too LargeScript returns error: "File too large (413 Payload Too Large)"Indicate 20MB limit exceeded, suggest reducing backup size
Encryption failedScript 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

执行步骤

  1. 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)
  2. Determine Output Directory
    • Default: Current working directory (
      .
      )
    • If user specified a directory, use user-specified directory
    • Warn user: Existing files may be overwritten
  3. 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)
  4. 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
  5. 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
  6. Display Success Message
    • List restored files
    • Show output directory
    • Suggest user verify file content
  1. 获取备份ID和密码
    • 检查用户是否提供了备份ID或下载链接
    • 如果未提供,使用读取工具读取
      .openclaw-backup-recovery.txt
    • 从文件中提取最新的备份ID和密码
    • 如果文件不存在或为空,则无法继续(密码未知)
  2. 确定输出目录
    • 默认:当前工作目录(
      .
    • 如果用户指定了目录,使用用户指定的目录
    • 警告用户:现有文件可能会被覆盖
  3. 执行恢复脚本
    • 使用恢复文件中的密码执行命令:
      bash
      python3 scripts/backup.py download \
        --backup-id "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \
        --password "password-from-recovery-file" \
        --output-dir "."
    • 捕获标准输出(JSON响应)和标准错误(进度信息)
  4. 处理响应
    • 成功时,脚本输出如下JSON:
      json
      {
        "success": true,
        "extractedFiles": ["SOUL.md", "MEMORY.md", "IDENTITY.md"],
        "outputDir": "/path/to/output"
      }
    • 解析提取的文件列表
  5. 验证恢复结果
    • 使用读取工具读取恢复文件的前几行
    • 向用户显示文件预览,确认内容正确
    • 提醒用户检查完整内容
  6. 显示成功消息
    • 列出恢复的文件
    • 显示输出目录
    • 建议用户验证文件内容

Error Handling

错误处理

Error ScenarioDetectionUser Guidance
Backup ID doesn't existScript returns error: "Backup not found: ..."Check if Backup ID is correct, may have been deleted
Recovery file missing
.openclaw-backup-recovery.txt
not found
Cannot restore - password is unknown without recovery file
Wrong passwordScript returns error: "Decryption failed - wrong password ..."Recovery file may be corrupted or from different backup
Network errorScript returns error: "Network error: ..."Suggest checking network connection, ask if retry is wanted
Extraction failedScript returns error: "tar extraction failed: ..."File may be corrupted, try downloading again
错误场景检测方式用户指引
备份ID不存在脚本返回错误:"Backup not found: ..."检查备份ID是否正确,可能已被删除
恢复文件缺失
.openclaw-backup-recovery.txt
未找到
无法恢复 - 没有恢复文件则无法获取密码
密码错误脚本返回错误:"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

执行步骤

  1. 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
  2. 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
  3. 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)
  4. Process Response
    • On success, script outputs JSON:
      json
      {
        "success": true,
        "backupId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
      }
  5. 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
  6. 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
  1. 获取备份ID
    • 检查用户是否提供了备份ID
    • 如果未提供,使用读取工具读取
      .openclaw-backup-recovery.txt
    • 显示可用备份列表供用户选择
    • 如果文件不存在或为空,询问用户提供备份ID
  2. 请求确认
    • 警告:此操作不可逆,备份将被永久删除
    • 显示要删除的备份ID和创建时间
    • 询问用户是否确认删除
  3. 执行删除脚本
    • 用户确认后,执行命令:
      bash
      python3 scripts/backup.py delete \
        --backup-id "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    • 捕获标准输出(JSON响应)和标准错误(进度信息)
  4. 处理响应
    • 成功时,脚本输出如下JSON:
      json
      {
        "success": true,
        "backupId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
      }
  5. 更新恢复信息文件
    • 使用读取工具读取
      .openclaw-backup-recovery.txt
    • 删除已删除备份的记录(包括其密码)
    • 使用写入工具保存更新后的文件
    • 如果文件变为空,可以删除该文件
  6. 显示成功消息
    • 确认备份已删除
    • 显示已删除的备份ID
    • 提醒用户:如果需要再次备份,必须创建新的备份并使用新的自动生成密码

Error Handling

错误处理

Error ScenarioDetectionUser Guidance
Backup ID doesn't existScript returns error: "Backup not found: ..."Backup may have been deleted or ID is incorrect
Network errorScript returns error: "Network error: ..."Suggest checking network connection, ask if retry is wanted
User cancelsUser declines confirmationOperation 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
    .openclaw-backup-recovery.txt
    (necessary for decryption)
  • 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:
    .openclaw-backup-recovery.txt
    (workspace root directory)
  • Content: Backup ID, Password (CRITICAL), Download URL, timestamp, SHA256
  • CRITICAL: Recovery file is the ONLY place password is stored
  • Recommendation:
    • Add to
      .gitignore
      if sensitive
    • OR commit to version control for team access
    • Consider backing up recovery file itself to separate secure location
  • 文件位置
    .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:
EndpointMethodFunctionResponse
/backup
POSTUpload backup
{backupId, downloadUrl, sizeBytes, sha256}
/backup/:backupId
GETDownload backup302 redirect to R2 storage URL
/backup/:backupId
DELETEDelete backup
{success: true, backupId}
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:
端点方法功能响应
/backup
POST上传备份
{backupId, downloadUrl, sizeBytes, sha256}
/backup/:backupId
GET下载备份302重定向至R2存储URL
/backup/:backupId
DELETE删除备份
{success: true, backupId}
常见状态码:
  • 200 - 成功
  • 404 - 备份未找到
  • 413 - 文件过大(超过20MB)
  • 415 - 不支持的文件类型
  • 500 - 服务器错误

Troubleshooting

故障排除

Missing Dependencies

依赖缺失

Problem: Script error "Missing required tools: tar, openssl"
Solution:
  • macOS:
    brew install openssl
    (tar built-in)
  • Ubuntu/Debian:
    sudo apt-get install tar openssl
  • Verify installation:
    tar --version
    and
    openssl version
问题:脚本错误 "Missing required tools: tar, openssl"
解决方案:
  • macOS:
    brew install openssl
    (tar为系统内置)
  • Ubuntu/Debian:
    sudo apt-get install tar openssl
  • 验证安装:
    tar --version
    openssl 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 requests

or

pip3 install requests
undefined
pip3 install requests
undefined

Recovery 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

最佳实践

  1. Regular Backups: Recommend weekly backups or after important changes
  2. Recovery File Management: Keep
    .openclaw-backup-recovery.txt
    safe and backed up separately
  3. Verify Restoration: Regularly test backup restoration process to ensure backups are usable
  4. Clean Old Backups: Regularly delete unneeded old backups to save storage space
  5. Multiple Copies: Consider keeping recovery file in multiple secure locations
  1. 定期备份:建议每周备份或在重要更改后备份
  2. 恢复文件管理:妥善保管
    .openclaw-backup-recovery.txt
    并单独备份
  3. 验证恢复:定期测试备份恢复过程,确保备份可用
  4. 清理旧备份:定期删除不需要的旧备份以节省存储空间
  5. 多副本:考虑将恢复文件保存在多个安全位置

Script Path

脚本路径

Script file is located in Skill directory at
scripts/backup.py
.
When 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
    cd
    to Skill directory first
脚本文件位于技能目录下的
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新增)