Backup and restore tool for Hermes Agent + OpenClaw installations.
- Incremental-aware discovery: Backs up
~/work/hermes-agent,~/work/openclaw,~/.hermes,~/.openclaw, systemd units, and more - SQLite-safe: Uses
sqlite3 .backupfor live database copies - Compressed archives:
tar.zstformat with zstd compression - Google Drive upload: Via
rcloneintegration - Cross-platform home dir: Uses
dirscrate — no hardcoded paths - Auto workspace discovery: Scans
~/.openclaw/workspace*dynamically
cd tools/hbackup
cargo build --release
cp target/release/hbackup ~/.local/bin/# Create backup
hbackup backup
# Dry run
hbackup backup --dry-run
# Custom output
hbackup backup -o /mnt/external/my-backup.tar.zst
# Exclude patterns
hbackup backup -x target -x .git# Restore from archive
hbackup restore ~/backups/hermes-openclaw-backup-20260101-120000.tar.zst
# Dry run
hbackup restore --dry-run ~/backups/...
# Force overwrite
hbackup restore --force ~/backups/...hbackup list# Setup guide
hbackup setup drive
# Upload to Google Drive (requires rclone configured)
hbackup upload --drive ~/backups/hermes-openclaw-backup-*.tar.zst
# Custom remote name / folder
hbackup upload --drive --drive-remote mygdrive --drive-folder backups/2026 ~/backups/...# Create backup then upload to configured destination
hbackup autoConfigure ~/.config/hbackup/config.toml:
[upload]
destination = "user@server:/backups/" # scp/rsync
drive_remote = "gdrive" # Google Drive remote name
drive_folder = "backups/hermes" # Google Drive folder# Daily backup at 3 AM
0 3 * * * /home/USER/.local/bin/hbackup auto >> /home/USER/.local/state/hermes/hbackup-cron.log 2>&1~/.config/hbackup/config.toml:
[upload]
# For scp/rsync upload:
method = "scp" # or "rsync"
destination = "user@backup-server:/backups/"
# For Google Drive upload:
drive_remote = "gdrive"
drive_folder = "backups/hermes"| Path | Description |
|---|---|
~/work/hermes-agent |
Hermes Agent source and config |
~/work/openclaw |
OpenClaw workspace |
~/.hermes |
Hermes state, logs, cache |
~/.openclaw |
OpenClaw config, workspaces (auto-discovered) |
~/.config/systemd/user/ |
User systemd units |
| SQLite databases | Copied safely via sqlite3 .backup |
This tool was extracted from a personal setup. Before publishing:
- All hardcoded paths removed (uses
dirs::home_dir()) - Workspace names auto-discovered from
~/.openclaw/workspace* - No user-specific paths remain
MIT
