Install
openclaw skills install @jlacroix82/backup-syncIntelligent file backup with compression and verification. Backup, sync, verify integrity, dedup, and restore. Manifest tracking. Zero external dependencies.
openclaw skills install @jlacroix82/backup-syncStop losing config changes to disk failures. Start backing up intelligently.
Config files, skills, memory — they're all on one disk with no backup strategy. When something breaks, everything is gone. Manual backups are error-prone and inconsistent.
Smart Backup fixes this with automated backup, sync, verification, and deduplication.
--restore overwrites target files with backup contents--sync two-way merges can create conflicts--dry-run first
Always preview with --dry-run before executing.If backup intervals overlap or the same source is backed up to the same destination multiple times, files will accumulate with timestamps. Periodically audit the backup directory for unexpected duplicates.
Backup manifests (manifest.json) contain full file paths and sizes, which may reveal directory structure and filenames. Treat manifests as sensitive metadata.
The backup journal and deduplication hash database persist under the backup destination. These files (incremental-index.json, dedup-hashes.json) grow with each backup run.
This version includes safety fixes for the three ClawHub security audit findings:
--no-delete — Default for sync (safe)By default, sync does not delete files in the destination that are absent from the source. This prevents accidental data loss.
--no-delete (default): files in dest not in source are skipped and logged with a WARNING--delete: enables deletion. Without --force, lists files that would be deleted but does not delete them--delete --force: actually deletes files absent from source, logging each one--force — Required for restore overwrite--restore skips existing files by default instead of silently overwriting them.
--force: existing files are skipped; WARNING logged for each--force: existing files are overwritten; OVERWRITE logged for eachRestore uses the relative path from the manifest's source directory, preserving the original directory tree. Files land at destination/<relative-path>, not flattened into destination/<basename>.
The test/ and tests/ directories are development artifacts and are not included in the published skill bundle.
node skills/smart-backup/smart-backup.js --backup ~/openclaw /path/to/backup
node skills/smart-backup/smart-backup.js --backup --dry-run ~/openclaw /path/to/backup
node skills/smart-backup/smart-backup.js --sync ~/openclaw /path/to/backup/sync
Syncs only changed files. By default, files present in the destination but absent from the source are not deleted (--no-delete is the default). To enable deletion of such files, use --delete. Always pair with --dry-run first.
node skills/smart-backup/smart-backup.js --sync --dry-run ~/openclaw /path/to/backup/sync
node skills/smart-backup/smart-backup.js --verify /path/to/backup-xxx
Checks SHA-256 hashes of all files against manifest.
node skills/smart-backup/smart-backup.js --dedup ~/openclaw
Groups files by content hash, shows sizes and paths.
node skills/smart-backup/smart-backup.js --list
node skills/smart-backup/smart-backup.js --restore /path/to/backup-xxx /restore/path
Restores files preserving the original directory structure from the manifest. Existing destination files are skipped by default. Use --force to overwrite them.
node skills/smart-backup/smart-backup.js --status
# First backup (full)
node skills/smart-backup/smart-backup.js --backup /source /dest
# Subsequent backups (only changed files)
node skills/smart-backup/smart-backup.js --backup /source /dest --incr
Hash-based change detection — skips unchanged files for 10-100x speedup.
.git, node_modules, .cache, .npm by default--incr flag enables hash-based change detection--from-manifest <id> to base diff on specific manifestBackups stored in: backups/smart-backups/
Manifest stored in: backups/smart-backups/manifest.json
Override data directory:
--dir /path/to/data
During heartbeats and maintenance:
--backup your workspace to a safe location--verify the latest backup--dedup to find and clean duplicates--list to check backup health--dry-run before sync/backup on important dirsAdd to your HEARTBEAT.md:
### 💾 Smart Backup
- Weekly: `node skills/smart-backup/smart-backup.js --backup ~/openclaw /path/to/backup`
- Verify: `node skills/smart-backup/smart-backup.js --verify <latest-backup>`
- Dedup: `node skills/smart-backup/smart-backup.js --dedup ~/openclaw`
| Approach | Integrity Check | Dedup | Manifest | Automation |
|---|---|---|---|---|
cp -r | ❌ | ❌ | ❌ | Manual |
rsync | ⚠️ | ❌ | ❌ | Auto |
| Smart Backup | ✅ | ✅ | ✅ | Auto |
Smart Backup gives you integrity verification + dedup + manifest tracking in one tool.