Hermes Backup
Universal backup and restore for AI agent platforms. Works with Hermes Agent and OpenClaw.
What Makes This Different
- - Multi-platform — Works with both Hermes (
~/.hermes/) and OpenClaw (~/.openclaw/) - Optional encryption — Password-protect your backups (AES-256)
- Optional cloud — Set up S3, Google Drive, or Dropbox if you want off-site storage
- Flexible backups — Full or incremental, your choice
- Smart retention — Keep last N backups, or N days, or max N GB
- Integrity checking — Verify backups before trusting them
- Web UI — Browser-based management with progress bars
Installation
CODEBLOCK0
Quick Start
CODEBLOCK1
Commands
| Command | Description |
|---|
| INLINECODE2 | Create backup (full or incremental) |
| INLINECODE3 |
Restore from backup |
|
hermes-backup serve | Start web UI |
|
hermes-backup config | Interactive configuration |
|
hermes-backup cloud setup | Configure cloud storage |
|
hermes-backup list | Show all backups |
|
hermes-backup verify <file> | Check backup integrity |
|
hermes-backup schedule | Set up automatic backups |
What Gets Backed Up
Hermes Agent Structure
| Component | Path | Contents |
|---|
| Config | INLINECODE10 | All settings, API keys |
| Environment |
~/.hermes/.env | API keys, secrets |
|
Identity |
~/.hermes/SOUL.md | Agent personality |
|
Memory |
~/.hermes/memories/ | Long-term memories |
|
Sessions |
~/.hermes/sessions/ | Conversation history |
|
Skills |
~/.hermes/skills/ | Installed skills |
|
State |
~/.hermes/state.db | Database |
|
Workspace |
~/.openclaw/workspace/ | Cross-platform workspace |
OpenClaw Structure
| Component | Path | Contents |
|---|
| Config | INLINECODE18 | Gateway, models, channels |
| Workspace |
~/.openclaw/workspace/ | Agent files, skills |
|
Credentials |
~/.openclaw/credentials/ | Channel pairing state |
|
Sessions |
~/.openclaw/agents/main/sessions/ | Chat history |
|
Skills |
~/.openclaw/skills/ | System skills |
|
Cron |
~/.openclaw/cron/ | Scheduled jobs |
Configuration
Interactive Setup
CODEBLOCK2
This walks you through:
- 1. Platform detection — Hermes or OpenClaw (auto-detected)
- Backup location — Where to save archives
- Encryption — Enable password protection? (optional)
- Backup type — Full or incremental?
- Retention — How many backups to keep?
- Cloud — Set up cloud storage? (optional)
Config File (~/.hermes-backup/config.yaml)
CODEBLOCK3
Creating Backups
Full Backup (Default)
CODEBLOCK4
Incremental Backup
CODEBLOCK5
Encrypted Backup
CODEBLOCK6
⚠️ Warning: If you lose the encryption password, the backup is unrecoverable. Store it in a password manager.
With Cloud Upload
CODEBLOCK7
Restoring Backups
Standard Restore
CODEBLOCK8
Encrypted Restore
CODEBLOCK9
Selective Restore
CODEBLOCK10
Cloud Storage Setup
Amazon S3
CODEBLOCK11
Google Drive
CODEBLOCK12
Dropbox
CODEBLOCK13
Testing Cloud Connection
CODEBLOCK14
Scheduling Automatic Backups
Via Cron
CODEBLOCK15
Manual Cron Entry
CODEBLOCK16
Web UI
CODEBLOCK17
Integrity Verification
CODEBLOCK18
Listing Backups
CODEBLOCK19
Migration Between Platforms
Hermes → OpenClaw
CODEBLOCK20
OpenClaw → Hermes
Same process, reverse direction.
Security Considerations
Backup Archive Contents
Backups contain
highly sensitive data:
- - API keys (OpenAI, Anthropic, ElevenLabs, etc.)
- Bot tokens (Telegram, Discord, etc.)
- Session data
- Personal memories/conversations
Security Best Practices
- 1. File Permissions
- Backups created with
chmod 600 (owner only)
- Never
chmod 777 a backup
- 2. Storage
- Keep local backups in encrypted disk/VeraCrypt
- Cloud backups: use provider encryption at rest
- Never commit backups to git
- 3. Transmission
- Use scp/sftp, not email
- Cloud uploads use HTTPS
- Web UI uses token authentication
- 4. Encryption Password
- Use a password manager (1Password, Bitwarden)
- Minimum 12 characters
- Mix of uppercase, lowercase, numbers, symbols
- Never reuse passwords
- 5. Rotation
- Old backups may contain old API keys
- Rotate API keys periodically
- Delete backups older than needed
Troubleshooting
"Permission denied" on backup
CODEBLOCK21
"Backup is corrupted"
CODEBLOCK22
"Cloud upload failed"
CODEBLOCK23
Restore fails halfway
CODEBLOCK24
Scripts Reference
scripts/backup.sh
Main backup script. Creates
.tar.gz archive with MANIFEST.json.
scripts/restore.sh
Restores from archive. Always dry-runs first. Creates pre-restore backup.
scripts/serve.sh
Starts web UI server. Requires
--token for security.
scripts/verify.sh
Verifies backup integrity using checksums.
scripts/cloud-upload.sh
Uploads backup to configured cloud storage.
scripts/config.sh
Interactive configuration wizard.
Version History
v1.0.0
- - Initial release
- Multi-platform support (Hermes + OpenClaw)
- Full and incremental backups
- Optional encryption (AES-256)
- Optional cloud storage (S3, Google Drive, Dropbox)
- Web UI for browser-based management
- Integrity verification
- Flexible retention policies
- Migration support between platforms
License
MIT-0 — Free to use, modify, and redistribute. No attribution required.
Built for the MyClaw.ai ecosystem — the open AI personal assistant platform.
Hermes Backup
适用于AI代理平台的通用备份与恢复工具。兼容 Hermes Agent 和 OpenClaw。
独特优势
- - 多平台支持 — 同时兼容 Hermes (~/.hermes/) 和 OpenClaw (~/.openclaw/)
- 可选加密 — 使用密码保护您的备份(AES-256加密)
- 可选云存储 — 支持配置S3、Google Drive或Dropbox实现异地存储
- 灵活备份 — 支持全量备份和增量备份,任您选择
- 智能保留策略 — 可保留最近N个备份、N天内的备份或最大N GB的备份
- 完整性校验 — 在信任备份前进行完整性验证
- Web界面 — 基于浏览器的管理界面,支持进度条显示
安装
bash
通过ClawMart安装(推荐)
clawmart install hermes-backup
或手动安装
git clone https://github.com/yourname/hermes-backup
chmod +x hermes-backup/scripts/*.sh
快速开始
bash
创建您的第一个备份
hermes-backup create
或通过代理指令
创建我的代理备份
命令列表
| 命令 | 描述 |
|---|
| hermes-backup create | 创建备份(全量或增量) |
| hermes-backup restore <文件> |
从备份恢复 |
| hermes-backup serve | 启动Web界面 |
| hermes-backup config | 交互式配置 |
| hermes-backup cloud setup | 配置云存储 |
| hermes-backup list | 显示所有备份 |
| hermes-backup verify <文件> | 检查备份完整性 |
| hermes-backup schedule | 设置自动备份 |
备份内容
Hermes Agent 结构
| 组件 | 路径 | 内容 |
|---|
| 配置 | ~/.hermes/config.yaml | 所有设置、API密钥 |
| 环境变量 |
~/.hermes/.env | API密钥、机密信息 |
|
身份 | ~/.hermes/SOUL.md | 代理人格特征 |
|
记忆 | ~/.hermes/memories/ | 长期记忆 |
|
会话 | ~/.hermes/sessions/ | 对话历史 |
|
技能 | ~/.hermes/skills/ | 已安装技能 |
|
状态 | ~/.hermes/state.db | 数据库 |
|
工作区 | ~/.openclaw/workspace/ | 跨平台工作区 |
OpenClaw 结构
| 组件 | 路径 | 内容 |
|---|
| 配置 | ~/.openclaw/openclaw.json | 网关、模型、频道 |
| 工作区 |
~/.openclaw/workspace/ | 代理文件、技能 |
|
凭证 | ~/.openclaw/credentials/ | 频道配对状态 |
|
会话 | ~/.openclaw/agents/main/sessions/ | 聊天历史 |
|
技能 | ~/.openclaw/skills/ | 系统技能 |
|
定时任务 | ~/.openclaw/cron/ | 计划任务 |
配置
交互式设置
bash
hermes-backup config
该命令将引导您完成:
- 1. 平台检测 — Hermes或OpenClaw(自动检测)
- 备份位置 — 存档保存路径
- 加密 — 是否启用密码保护?(可选)
- 备份类型 — 全量还是增量?
- 保留策略 — 保留多少个备份?
- 云存储 — 是否设置云存储?(可选)
配置文件(~/.hermes-backup/config.yaml)
yaml
platform: auto # auto、hermes或openclaw
backup:
location: ~/backups/hermes
type: full # full或incremental
compression: gzip # gzip、bzip2或none
encryption: false # true/false
retention:
strategy: count # count、days或size
keep_count: 10 # 保留最近N个备份
keep_days: 30 # 或保留N天内的备份
maxsizegb: 5 # 或最大总大小
incremental:
enabled: false
base_backup: null # 参考全量备份
cloud:
enabled: false
provider: null # s3、gdrive、dropbox
# 提供商特定设置在安装时添加
integrity:
verifyafterbackup: true
checksum_algorithm: sha256
创建备份
全量备份(默认)
bash
hermes-backup create
→ ~/backups/hermes/hermes-backup20260326143022.tar.gz
增量备份
bash
首先创建基础备份
hermes-backup create --full --tag base-2026-03-26
然后增量备份引用基础备份
hermes-backup create --incremental --base base-2026-03-26
加密备份
bash
hermes-backup create --encrypt
提示输入密码(不回显)
⚠️ 警告: 如果丢失加密密码,备份将无法恢复。请将其存储在密码管理器中。
带云上传
bash
hermes-backup create --cloud-upload
在本地创建备份,然后上传到配置的云存储
恢复备份
标准恢复
bash
始终先进行试运行
hermes-backup restore ~/backups/hermes/hermes-backup
20260326143022.tar.gz --dry-run
如果看起来没问题,则执行恢复
hermes-backup restore ~/backups/hermes/hermes-backup
20260326143022.tar.gz
加密恢复
bash
hermes-backup restore ~/backups/hermes/hermes-backup
20260326143022.tar.gz.enc
提示输入密码
选择性恢复
bash
仅恢复特定组件
hermes-backup restore backup.tar.gz --components workspace,skills
云存储设置
Amazon S3
bash
hermes-backup cloud setup s3
提示输入:
- AWS访问密钥ID
- AWS秘密访问密钥
- 存储桶名称
- 区域(可选,默认为us-east-1)
Google Drive
bash
hermes-backup cloud setup gdrive
打开浏览器进行OAuth认证
或为无头环境提供手动令牌设置
Dropbox
bash
hermes-backup cloud setup dropbox
OAuth流程或手动令牌
测试云连接
bash
hermes-backup cloud test
验证凭据并上传测试文件
设置自动备份
通过Cron
bash
hermes-backup schedule
交互式设置:
- 备份频率?(每天、每周、每小时)
- 备份时间?
- 全量还是增量?
- 是否上传到云?
手动Cron条目
bash
添加到crontab
0 3
* /usr/local/bin/hermes-backup create --quiet --cloud-upload
每天凌晨3点,静默模式,上传到云
Web界面
bash
hermes-backup serve --port 7373 --token YOUR_TOKEN
在浏览器中打开 http://localhost:7373
功能:
- 创建备份(点击按钮)
- 下载备份
- 上传和恢复
- 查看备份历史
- 配置设置
- 操作进度条
完整性验证
bash
验证特定备份
hermes-backup verify ~/backups/hermes/hermes-backup
20260326143022.tar.gz
检查所有备份
hermes-backup verify --all
结果:
✓ 备份有效且可恢复
✗ 备份已损坏或不完整
列出备份
bash
hermes-backup list
输出:
备份名称 大小 日期 类型 加密 云存储
hermes-backup20260326143022.tar.gz 45MB 2026-03-26 full no yes
hermes-backup20260325090015.tar.gz 2MB 2026-03-25 incr yes no
平台间迁移
Hermes → OpenClaw
bash