{"id":"581714dd-7dab-4418-a1d3-c61e7bbe6173","entityType":"agent","slug":"clawhub-jlacroix82-backup-sync","name":"Smart Backup","canonicalUrl":"https://www.xpersona.co/agent/clawhub-jlacroix82-backup-sync","canonicalPath":"/agent/clawhub-jlacroix82-backup-sync","generatedAt":"2026-10-12T20:16:08.761Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"editorial-content","verified":true,"confidence":"high","updatedAt":"2026-10-11T21:31:26.896Z","emptyReason":null},"description":"Intelligent file backup with compression and verification. Backup, sync, verify integrity, dedup, and restore. Manifest tracking. Zero external dependencies. Skill: Smart Backup Owner: jlacroix82 Summary: Intelligent file backup with compression and verification. Backup, sync, verify integrity, dedup, and restore. Manifest tracking. Zero external dependencies. Tags: latest:1.0.8, security-fix:1.0.1 Version history: v1.0.8 | 2026-07-22T21:54:12.458Z | user v1.0.8: Safety fixes - restore preserves directory structure, --no-delete default for sync, --force for restore overwr","descriptionLabel":"Technical summary","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 990 downloads reported by the source. Last updated 10/11/2026.","installCommand":"clawhub skill install s175p518b8g47fx6r9zyvs95ks876t4t:backup-sync","sourceUrl":"https://clawhub.ai/jlacroix82/backup-sync","homepage":"https://clawhub.ai/jlacroix82/skills/backup-sync","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/jlacroix82/backup-sync","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/jlacroix82/skills/backup-sync","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":60,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"Intelligent file backup with compression and verification. Backup, sync, verify integrity, dedup, and restore. Manifest tracking. Zero external dependencies. Sk"},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-11T21:31:26.896Z","emptyReason":null},"protocols":[{"protocol":"OPENCLEW","label":"OpenClaw","status":"self-declared","notes":"Declared in the public agent profile."}],"capabilities":[],"verifiedCount":0,"selfDeclaredCount":1,"capabilityMatrix":{"rows":[{"key":"OPENCLEW","type":"protocol","support":"unknown","confidenceSource":"profile","notes":"Listed on profile"}],"flattenedTokens":"protocol:OPENCLEW|unknown|profile"}},"adoption":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-11T21:31:26.896Z","emptyReason":null},"stars":null,"forks":null,"downloads":990,"likes":null,"task":null,"library":null,"packageName":null,"latestVersion":"1.0.8","tractionLabel":"990 downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-11T21:31:26.823Z","emptyReason":null},"lastUpdatedAt":"2026-10-11T21:31:26.896Z","lastCrawledAt":"2026-10-11T21:31:26.823Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-12T21:31:26.823Z","lastVerifiedAt":null,"highlights":[{"version":"1.0.8","createdAt":"2026-07-22T21:54:12.458Z","changelog":"v1.0.8: Safety fixes - restore preserves directory structure, --no-delete default for sync, --force for restore overwrite","fileCount":6,"zipByteSize":11139},{"version":"1.0.7","createdAt":"2026-07-22T21:53:08.332Z","changelog":"v1.0.7: Safety fix - restore preserves directory structure, --no-delete default for sync, --force for restore overwrite","fileCount":6,"zipByteSize":10952},{"version":"1.0.6","createdAt":"2026-07-22T21:52:01.626Z","changelog":"v1.0.6: Fix restore path flattening (now preserves relative paths), add --no-delete default for sync (safer), add --force flag required for restore overwrite. Static analysis unchanged.","fileCount":6,"zipByteSize":11209},{"version":"1.0.5","createdAt":"2026-07-22T21:51:13.091Z","changelog":"v1.0.5: Fix restore path flattening (now preserves relative paths), add --no-delete default for sync (safer), add --force flag required for restore overwrite. Static analysis unchanged.","fileCount":6,"zipByteSize":11206},{"version":"1.0.4","createdAt":"2026-07-22T16:26:28.944Z","changelog":"Security: file system scope disclosure, data handling warnings","fileCount":8,"zipByteSize":12363},{"version":"1.0.2","createdAt":"2026-07-22T16:04:21.206Z","changelog":"Security improvements: clarified data storage warnings, updated security documentation, fixed descriptions to match actual behavior.","fileCount":8,"zipByteSize":12406},{"version":"1.0.1","createdAt":"2026-07-20T01:57:00.403Z","changelog":"Restore and sync now require --force for destructive operations, overwrite preview with file count before proceeding. 19 tests.","fileCount":8,"zipByteSize":12399},{"version":"1.0.0","createdAt":"2026-07-18T21:40:56.764Z","changelog":"Initial release: 21/21 self-tests, gzip compression, manifest tracking with SHA-256, file deduplication, incremental backup, verification. Zero external dependencies. Rebuilt from scratch after file corruption.","fileCount":8,"zipByteSize":11991}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s175p518b8g47fx6r9zyvs95ks876t4t:backup-sync","setupComplexity":"low","setupSteps":["Setup complexity is classified as HIGH. You must provision dedicated cloud infrastructure or an isolated VM. Do not run this directly on your local workstation.","Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data."],"contract":{"contractStatus":"missing","authModes":[],"requires":[],"forbidden":[],"supportsMcp":false,"supportsA2a":false,"supportsStreaming":false,"inputSchemaRef":null,"outputSchemaRef":null,"dataRegion":null,"contractUpdatedAt":null,"sourceUpdatedAt":null,"freshnessSeconds":null},"invocationGuide":{"preferredApi":{"snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-jlacroix82-backup-sync/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-jlacroix82-backup-sync/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-jlacroix82-backup-sync/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-jlacroix82-backup-sync/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-jlacroix82-backup-sync/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-jlacroix82-backup-sync/trust\""],"jsonRequestTemplate":{"query":"summarize this repo","constraints":{"maxLatencyMs":2000,"protocolPreference":["OPENCLEW"]}},"jsonResponseTemplate":{"ok":true,"result":{"summary":"...","confidence":0.9},"meta":{"source":"CLAWHUB","generatedAt":"2026-10-12T20:16:08.759Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-jlacroix82-backup-sync/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-jlacroix82-backup-sync/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-jlacroix82-backup-sync/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-jlacroix82-backup-sync/trust"}},"reliability":{"evidence":{"source":"runtime-metrics","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No trust, reliability, or runtime telemetry is available."},"trust":{"status":"unavailable","handshakeStatus":"UNKNOWN","verificationFreshnessHours":null,"reputationScore":null,"p95LatencyMs":null,"successRate30d":null,"fallbackRate":null,"attempts30d":null,"trustUpdatedAt":null,"trustConfidence":"unknown","sourceUpdatedAt":null,"freshnessSeconds":null},"decisionGuardrails":{"doNotUseIf":["Contract metadata is missing or unavailable for deterministic execution."],"safeUseWhen":[],"riskFlags":["missing_or_unavailable_contract","trust_data_unavailable","schema_references_missing"],"operationalConfidence":"low"},"executionMetrics":{"observedLatencyMsP50":null,"observedLatencyMsP95":null,"estimatedCostUsd":null,"uptime30d":null,"rateLimitRpm":null,"rateLimitBurst":null,"lastVerifiedAt":null,"verificationSource":null},"runtimeMetrics":{"successRate":null,"avgLatencyMs":null,"avgCostUsd":null,"hallucinationRate":null,"retryRate":null,"disputeRate":null,"p50Latency":null,"p95Latency":null,"lastUpdated":null}},"benchmarks":{"evidence":{"source":"no-benchmark-data","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No benchmark suites or observed failure patterns are available."},"suites":[],"failurePatterns":[]},"artifacts":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"high","updatedAt":"2026-10-11T21:31:26.896Z","emptyReason":null},"readme":"Skill: Smart Backup\n\nOwner: jlacroix82\n\nSummary: Intelligent file backup with compression and verification. Backup, sync, verify integrity, dedup, and restore. Manifest tracking. Zero external dependencies.\n\nTags: latest:1.0.8, security-fix:1.0.1\n\nVersion history:\n\nv1.0.8 | 2026-07-22T21:54:12.458Z | user\n\nv1.0.8: Safety fixes - restore preserves directory structure, --no-delete default for sync, --force for restore overwrite\n\nv1.0.7 | 2026-07-22T21:53:08.332Z | user\n\nv1.0.7: Safety fix - restore preserves directory structure, --no-delete default for sync, --force for restore overwrite\n\nv1.0.6 | 2026-07-22T21:52:01.626Z | user\n\nv1.0.6: Fix restore path flattening (now preserves relative paths), add --no-delete default for sync (safer), add --force flag required for restore overwrite. Static analysis unchanged.\n\nv1.0.5 | 2026-07-22T21:51:13.091Z | user\n\nv1.0.5: Fix restore path flattening (now preserves relative paths), add --no-delete default for sync (safer), add --force flag required for restore overwrite. Static analysis unchanged.\n\nv1.0.4 | 2026-07-22T16:26:28.944Z | user\n\nSecurity: file system scope disclosure, data handling warnings\n\nv1.0.2 | 2026-07-22T16:04:21.206Z | user\n\nSecurity improvements: clarified data storage warnings, updated security documentation, fixed descriptions to match actual behavior.\n\nv1.0.1 | 2026-07-20T01:57:00.403Z | user\n\nRestore and sync now require --force for destructive operations, overwrite preview with file count before proceeding. 19 tests.\n\nv1.0.0 | 2026-07-18T21:40:56.764Z | user\n\nInitial release: 21/21 self-tests, gzip compression, manifest tracking with SHA-256, file deduplication, incremental backup, verification. Zero external dependencies. Rebuilt from scratch after file corruption.\n\nArchive index:\n\nArchive v1.0.8: 6 files, 11139 bytes\n\nFiles: clawhub.yaml (379b), README.md (3272b), skill-card.md (2288b), SKILL.md (7595b), smart-backup.js (19269b), _meta.json (130b)\n\nFile v1.0.8:SKILL.md\n\n---\nname: smart-backup\ndescription: Intelligent file backup with compression and verification. Backup, sync, verify integrity, dedup, and restore. Manifest tracking. Zero external dependencies.\n---\n\n# Smart Backup 💾\n\n**Stop losing config changes to disk failures. Start backing up intelligently.**\n\n## The Problem\n\nConfig 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.\n\nSmart Backup fixes this with automated backup, sync, verification, and deduplication.\n\n## ⚠️ Important Warnings\n\n### Destructive Restore / Sync\n- `--restore` overwrites target files with backup contents\n- `--sync` two-way merges can create conflicts\n- Both operations are irreversible if run without `--dry-run` first\nAlways preview with `--dry-run` before executing.\n\n### Silent Data Duplication\nIf 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.\n\n### Manifest Privacy\nBackup manifests (`manifest.json`) contain full file paths and sizes, which may reveal directory structure and filenames. Treat manifests as sensitive metadata.\n\n### Incremental Metadata Persistence\nThe backup journal and deduplication hash database persist under the backup destination. These files (`incremental-index.json`, `dedup-hashes.json`) grow with each backup run.\n\n## Safety\n\nThis version includes safety fixes for the three ClawHub security audit findings:\n\n### `--no-delete` — Default for sync (safe)\nBy default, sync **does not delete** files in the destination that are absent from the source. This prevents accidental data loss.\n\n- `--no-delete` (default): files in dest not in source are skipped and logged with a WARNING\n- `--delete`: enables deletion. Without `--force`, lists files that would be deleted but does not delete them\n- `--delete --force`: actually deletes files absent from source, logging each one\n\n### `--force` — Required for restore overwrite\n`--restore` **skips existing files by default** instead of silently overwriting them.\n\n- Without `--force`: existing files are skipped; WARNING logged for each\n- With `--force`: existing files are overwritten; OVERWRITE logged for each\n\n### Restore preserves directory structure\nRestore 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>`.\n\n### Tests excluded from published bundle\nThe `test/` and `tests/` directories are development artifacts and are **not included** in the published skill bundle.\n\n## Quick Start\n\n### Create a backup\n\n```bash\nnode skills/smart-backup/smart-backup.js --backup ~/openclaw /path/to/backup\n```\n\n### Preview backup without creating\n\n```bash\nnode skills/smart-backup/smart-backup.js --backup --dry-run ~/openclaw /path/to/backup\n```\n\n### Sync files between locations\n\n```bash\nnode skills/smart-backup/smart-backup.js --sync ~/openclaw /path/to/backup/sync\n```\n\nSyncs 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.\n\n### Preview sync\n\n```bash\nnode skills/smart-backup/smart-backup.js --sync --dry-run ~/openclaw /path/to/backup/sync\n```\n\n### Verify backup integrity\n\n```bash\nnode skills/smart-backup/smart-backup.js --verify /path/to/backup-xxx\n```\n\nChecks SHA-256 hashes of all files against manifest.\n\n### Find duplicate files\n\n```bash\nnode skills/smart-backup/smart-backup.js --dedup ~/openclaw\n```\n\nGroups files by content hash, shows sizes and paths.\n\n### List available backups\n\n```bash\nnode skills/smart-backup/smart-backup.js --list\n```\n\n### Restore from backup\n\n```bash\nnode skills/smart-backup/smart-backup.js --restore /path/to/backup-xxx /restore/path\n```\n\nRestores files preserving the original directory structure from the manifest. Existing destination files are **skipped** by default. Use `--force` to overwrite them.\n\n### Status overview\n\n```bash\nnode skills/smart-backup/smart-backup.js --status\n```\n\n### Incremental backup\n\n```bash\n# First backup (full)\nnode skills/smart-backup/smart-backup.js --backup /source /dest\n\n# Subsequent backups (only changed files)\nnode skills/smart-backup/smart-backup.js --backup /source /dest --incr\n```\n\nHash-based change detection — skips unchanged files for 10-100x speedup.\n\n## Features\n\n### Backup with Manifest\n\n- Creates timestamped backup directories\n- SHA-256 hash for every file in manifest\n- Total size and file count tracking\n- Skips `.git`, `node_modules`, `.cache`, `.npm` by default\n\n### Smart Sync\n\n- Copies new files, updates changed files, deletes extras\n- Hash-based change detection (not just timestamps)\n- Dry-run mode shows what would change before doing it\n\n### Integrity Verification\n\n- Verifies every file against stored SHA-256 hash\n- Reports missing files and hash mismatches\n- One-command verification of any backup\n\n### Incremental Backup\n\n- `--incr` flag enables hash-based change detection\n- Only backs up files that changed since last backup\n- Skips unchanged files (10-100x speedup)\n- Manifest tracks per-file SHA-256 hashes\n- `--from-manifest <id>` to base diff on specific manifest\n\n### Content-Aware Deduplication\n\n- Groups files by SHA-256 hash\n- Shows duplicate groups with sizes\n- Helps identify storage waste\n\n### Compression Ready\n\n- Manifest format supports compression (planned)\n- Estimated 60% compression savings shown in dry-run\n- Backup directory structure preserved\n\n## Configuration\n\nBackups stored in: `backups/smart-backups/`\n\nManifest stored in: `backups/smart-backups/manifest.json`\n\nOverride data directory:\n```bash\n--dir /path/to/data\n```\n\n## Agent Protocol\n\nDuring heartbeats and maintenance:\n\n1. **Weekly backup** — `--backup` your workspace to a safe location\n2. **Verify after backup** — `--verify` the latest backup\n3. **Dedup periodically** — `--dedup` to find and clean duplicates\n4. **List backups** — `--list` to check backup health\n5. **Dry-run first** — Always `--dry-run` before sync/backup on important dirs\n\n## Heartbeat Integration\n\nAdd to your `HEARTBEAT.md`:\n\n```markdown\n### 💾 Smart Backup\n\n- Weekly: `node skills/smart-backup/smart-backup.js --backup ~/openclaw /path/to/backup`\n- Verify: `node skills/smart-backup/smart-backup.js --verify <latest-backup>`\n- Dedup: `node skills/smart-backup/smart-backup.js --dedup ~/openclaw`\n```\n\n## Security Notes\n\n- File hashes are SHA-256 (integrity, not encryption)\n- Backups contain all file content — ensure backup storage is secure\n- Symlink-safe — uses standard fs operations\n- No network calls, all local\n\n## Comparison\n\n| Approach | Integrity Check | Dedup | Manifest | Automation |\n|----------|----------------|-------|----------|------------|\n| `cp -r` | ❌ | ❌ | ❌ | Manual |\n| `rsync` | ⚠️ | ❌ | ❌ | Auto |\n| **Smart Backup** | **✅** | **✅** | **✅** | **Auto** |\n\n**Smart Backup gives you integrity verification + dedup + manifest tracking in one tool.**\n\n## Design Principles\n\n1. **Zero setup** — Works immediately, no config needed\n2. **No dependencies** — Pure Node.js fs/crypto/zlib, no npm packages\n3. **Safe by default** — Skips known bloat directories, dry-run available\n4. **Transparent** — Every operation reports what it did\n5. **Persistent** — Manifests survive restarts and can verify integrity later\n\nFile v1.0.8:README.md\n\n# Smart Backup & Sync\n\nIntelligent file backup with gzip compression, incremental backups, verification, and deduplication.\n\n## Features\n\n- **Full Backups** — Create timestamped, compressed backups with manifest tracking\n- **Incremental Backups** — Only back up changed files since last manifest\n- **File Sync** — Sync files between directories with dry-run support\n- **Backup Verification** — Verify backup integrity (hash comparison)\n- **Restore** — Restore backups to a destination directory\n- **Deduplication** — Find duplicate files by content hash\n- **Status Overview** — View backup stats and storage health\n- **Compression** — Built-in gzip compression for backup files\n\n## Installation\n\n```bash\n# The skill is auto-loaded by OpenClaw via the skill registry.\n# For standalone use:\nconst SB = require('./smart-backup.js');\n```\n\n## Commands\n\n```\n--backup <source> <destination>           Create full backup\n--backup --dry-run <source> <dest>        Preview backup\n--sync <source> <destination>             Sync files between locations\n--sync --dry-run <source> <dest>          Preview sync\n--verify <backup_file>                    Verify backup integrity\n--dedup <dir>                             Content-aware deduplication\n--list                                     List available backups\n--restore <backup_file> <destination>     Restore from backup\n--status                                   Backup status overview\n```\n\n## API\n\n### `createBackup(source, destination, dryRun = false)`\nCreate a timestamped gzip-compressed backup of source directory.\n\n```javascript\nSB.createBackup('/home/user/projects', '/backups', false);\n```\n\n### `createIncrementalBackup(source, destination, fromManifest, dryRun)`\nOnly back up files that changed since the last manifest.\n\n```javascript\nSB.createIncrementalBackup('/home/user/projects', '/backups');\n```\n\n### `syncFiles(source, destination, dryRun)`\nSynchronize files from source to destination.\n\n```javascript\nSB.syncFiles('/home/user/projects', '/backups/mirror');\n```\n\n### `verifyBackup(backupFile)`\nVerify backup integrity by comparing file hashes.\n\n```javascript\nSB.verifyBackup('/backups/backup-2026-07-18-123456789');\n```\n\n### `listBackups()`\nList all available timestamped backups.\n\n### `restoreBackup(backupFile, destination)`\nRestore a backup to the specified destination.\n\n```javascript\nSB.restoreBackup('/backups/backup-2026-07-18-123456789', '/home/user/restored');\n```\n\n### `findDuplicates()`\nFind and report duplicate files by content hash.\n\n### `getFileHash(filepath)`\nGet SHA-256 hash of a file. Returns null for missing files.\n\n### `formatBytes(bytes)`\nFormat byte count as human-readable string (`1 KB`, `2.5 MB`).\n\n### `collectFiles(dir, skipDirs)`\nRecursively collect files in a directory, skipping common non-essential dirs.\n\n### `showStatus()`\nPrint backup system status (total backups, size, directory).\n\n## Security\n\n- File hashes computed using SHA-256\n- Backup files stored with manifest for integrity verification\n- No external dependencies — pure Node.js crypto + zlib\n- Dry-run mode for safe preview before executing\n\n## Testing\n\n```bash\nnode tests/run-self-tests.js\n```\n\n### Test Coverage\n\n| Suite | Tests | Status |\n|---|---|---|\n| Self-tests (isolated) | 19 | ✅ Passing |\n\nFile v1.0.8:_meta.json\n\n{\n  \"ownerId\": \"kn7b6eyf5vc7khg5fr63pjm8xd82qvw5\",\n  \"slug\": \"backup-sync\",\n  \"version\": \"1.0.8\",\n  \"publishedAt\": 1784757252458\n}\n\nFile v1.0.8:skill-card.md\n\n## Description:\n\nIntelligent file backup with compression and verification. Backup, sync, verify integrity, dedup, and restore. Manifest tracking. Zero external dependencies.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[jlacroix82](https://clawhub.ai/user/jlacroix82)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers and agents use Smart Backup to create local backups, sync directory copies, verify backup manifests, restore files, and identify duplicate content during workspace maintenance.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Local backup, sync, and restore operations may read, write, overwrite, delete, or restore files outside the locations a user intended.\n\nMitigation: Review paths before execution, run on non-sensitive test directories first, use dry-run previews, and avoid --force or --delete unless the affected paths have been inspected.\n\nRisk: Backups and manifests may expose sensitive file contents, full paths, sizes, and directory structure.\n\nMitigation: Store backups and manifests only in trusted locations with appropriate access controls, and avoid using the skill on sensitive directories until the release has been reviewed.\n\nRisk: Advertised compression, destination selection, symlink safety, and full SHA-256 integrity behavior may not match the implementation.\n\nMitigation: Do not rely on those claims for critical recovery workflows until implementation fixes are reviewed and verified.\n\n## Reference(s):\n\n- [ClawHub Skill Page](https://clawhub.ai/jlacroix82/skills/backup-sync)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, shell commands, configuration, guidance]\n\n**Output Format:** [Markdown with inline shell commands and configuration snippets]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Produces local backup, sync, verification, restore, deduplication, and status guidance for agent workflows.]\n\n## Skill Version(s):\n\n1.0.8 (source: server release evidence)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v1.0.8:clawhub.yaml\n\nslug: backup-sync\nname: backup-sync\ndescription: Intelligent file backup with compression, manifest tracking, verification, and deduplication. ⚠️ Destructive restore/sync. Always dry-run first.\nversion: 1.0.5\ntype: skill\nauthor: OpenClaw\nlicense: MIT\nkeywords:\n  - backup\n  - sync\n  - deduplication\n  - compression\n  - agent\nentry: SKILL.md\nowner: jlacroix82\ndependencies: []\n\nArchive v1.0.7: 6 files, 10952 bytes\n\nFiles: clawhub.yaml (379b), README.md (3272b), skill-card.md (1963b), SKILL.md (7595b), smart-backup.js (19263b), _meta.json (130b)\n\nFile v1.0.7:SKILL.md\n\n---\nname: smart-backup\ndescription: Intelligent file backup with compression and verification. Backup, sync, verify integrity, dedup, and restore. Manifest tracking. Zero external dependencies.\n---\n\n# Smart Backup 💾\n\n**Stop losing config changes to disk failures. Start backing up intelligently.**\n\n## The Problem\n\nConfig 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.\n\nSmart Backup fixes this with automated backup, sync, verification, and deduplication.\n\n## ⚠️ Important Warnings\n\n### Destructive Restore / Sync\n- `--restore` overwrites target files with backup contents\n- `--sync` two-way merges can create conflicts\n- Both operations are irreversible if run without `--dry-run` first\nAlways preview with `--dry-run` before executing.\n\n### Silent Data Duplication\nIf 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.\n\n### Manifest Privacy\nBackup manifests (`manifest.json`) contain full file paths and sizes, which may reveal directory structure and filenames. Treat manifests as sensitive metadata.\n\n### Incremental Metadata Persistence\nThe backup journal and deduplication hash database persist under the backup destination. These files (`incremental-index.json`, `dedup-hashes.json`) grow with each backup run.\n\n## Safety\n\nThis version includes safety fixes for the three ClawHub security audit findings:\n\n### `--no-delete` — Default for sync (safe)\nBy default, sync **does not delete** files in the destination that are absent from the source. This prevents accidental data loss.\n\n- `--no-delete` (default): files in dest not in source are skipped and logged with a WARNING\n- `--delete`: enables deletion. Without `--force`, lists files that would be deleted but does not delete them\n- `--delete --force`: actually deletes files absent from source, logging each one\n\n### `--force` — Required for restore overwrite\n`--restore` **skips existing files by default** instead of silently overwriting them.\n\n- Without `--force`: existing files are skipped; WARNING logged for each\n- With `--force`: existing files are overwritten; OVERWRITE logged for each\n\n### Restore preserves directory structure\nRestore 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>`.\n\n### Tests excluded from published bundle\nThe `test/` and `tests/` directories are development artifacts and are **not included** in the published skill bundle.\n\n## Quick Start\n\n### Create a backup\n\n```bash\nnode skills/smart-backup/smart-backup.js --backup ~/openclaw /path/to/backup\n```\n\n### Preview backup without creating\n\n```bash\nnode skills/smart-backup/smart-backup.js --backup --dry-run ~/openclaw /path/to/backup\n```\n\n### Sync files between locations\n\n```bash\nnode skills/smart-backup/smart-backup.js --sync ~/openclaw /path/to/backup/sync\n```\n\nSyncs 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.\n\n### Preview sync\n\n```bash\nnode skills/smart-backup/smart-backup.js --sync --dry-run ~/openclaw /path/to/backup/sync\n```\n\n### Verify backup integrity\n\n```bash\nnode skills/smart-backup/smart-backup.js --verify /path/to/backup-xxx\n```\n\nChecks SHA-256 hashes of all files against manifest.\n\n### Find duplicate files\n\n```bash\nnode skills/smart-backup/smart-backup.js --dedup ~/openclaw\n```\n\nGroups files by content hash, shows sizes and paths.\n\n### List available backups\n\n```bash\nnode skills/smart-backup/smart-backup.js --list\n```\n\n### Restore from backup\n\n```bash\nnode skills/smart-backup/smart-backup.js --restore /path/to/backup-xxx /restore/path\n```\n\nRestores files preserving the original directory structure from the manifest. Existing destination files are **skipped** by default. Use `--force` to overwrite them.\n\n### Status overview\n\n```bash\nnode skills/smart-backup/smart-backup.js --status\n```\n\n### Incremental backup\n\n```bash\n# First backup (full)\nnode skills/smart-backup/smart-backup.js --backup /source /dest\n\n# Subsequent backups (only changed files)\nnode skills/smart-backup/smart-backup.js --backup /source /dest --incr\n```\n\nHash-based change detection — skips unchanged files for 10-100x speedup.\n\n## Features\n\n### Backup with Manifest\n\n- Creates timestamped backup directories\n- SHA-256 hash for every file in manifest\n- Total size and file count tracking\n- Skips `.git`, `node_modules`, `.cache`, `.npm` by default\n\n### Smart Sync\n\n- Copies new files, updates changed files, deletes extras\n- Hash-based change detection (not just timestamps)\n- Dry-run mode shows what would change before doing it\n\n### Integrity Verification\n\n- Verifies every file against stored SHA-256 hash\n- Reports missing files and hash mismatches\n- One-command verification of any backup\n\n### Incremental Backup\n\n- `--incr` flag enables hash-based change detection\n- Only backs up files that changed since last backup\n- Skips unchanged files (10-100x speedup)\n- Manifest tracks per-file SHA-256 hashes\n- `--from-manifest <id>` to base diff on specific manifest\n\n### Content-Aware Deduplication\n\n- Groups files by SHA-256 hash\n- Shows duplicate groups with sizes\n- Helps identify storage waste\n\n### Compression Ready\n\n- Manifest format supports compression (planned)\n- Estimated 60% compression savings shown in dry-run\n- Backup directory structure preserved\n\n## Configuration\n\nBackups stored in: `backups/smart-backups/`\n\nManifest stored in: `backups/smart-backups/manifest.json`\n\nOverride data directory:\n```bash\n--dir /path/to/data\n```\n\n## Agent Protocol\n\nDuring heartbeats and maintenance:\n\n1. **Weekly backup** — `--backup` your workspace to a safe location\n2. **Verify after backup** — `--verify` the latest backup\n3. **Dedup periodically** — `--dedup` to find and clean duplicates\n4. **List backups** — `--list` to check backup health\n5. **Dry-run first** — Always `--dry-run` before sync/backup on important dirs\n\n## Heartbeat Integration\n\nAdd to your `HEARTBEAT.md`:\n\n```markdown\n### 💾 Smart Backup\n\n- Weekly: `node skills/smart-backup/smart-backup.js --backup ~/openclaw /path/to/backup`\n- Verify: `node skills/smart-backup/smart-backup.js --verify <latest-backup>`\n- Dedup: `node skills/smart-backup/smart-backup.js --dedup ~/openclaw`\n```\n\n## Security Notes\n\n- File hashes are SHA-256 (integrity, not encryption)\n- Backups contain all file content — ensure backup storage is secure\n- Symlink-safe — uses standard fs operations\n- No network calls, all local\n\n## Comparison\n\n| Approach | Integrity Check | Dedup | Manifest | Automation |\n|----------|----------------|-------|----------|------------|\n| `cp -r` | ❌ | ❌ | ❌ | Manual |\n| `rsync` | ⚠️ | ❌ | ❌ | Auto |\n| **Smart Backup** | **✅** | **✅** | **✅** | **Auto** |\n\n**Smart Backup gives you integrity verification + dedup + manifest tracking in one tool.**\n\n## Design Principles\n\n1. **Zero setup** — Works immediately, no config needed\n2. **No dependencies** — Pure Node.js fs/crypto/zlib, no npm packages\n3. **Safe by default** — Skips known bloat directories, dry-run available\n4. **Transparent** — Every operation reports what it did\n5. **Persistent** — Manifests survive restarts and can verify integrity later\n\nFile v1.0.7:README.md\n\n# Smart Backup & Sync\n\nIntelligent file backup with gzip compression, incremental backups, verification, and deduplication.\n\n## Features\n\n- **Full Backups** — Create timestamped, compressed backups with manifest tracking\n- **Incremental Backups** — Only back up changed files since last manifest\n- **File Sync** — Sync files between directories with dry-run support\n- **Backup Verification** — Verify backup integrity (hash comparison)\n- **Restore** — Restore backups to a destination directory\n- **Deduplication** — Find duplicate files by content hash\n- **Status Overview** — View backup stats and storage health\n- **Compression** — Built-in gzip compression for backup files\n\n## Installation\n\n```bash\n# The skill is auto-loaded by OpenClaw via the skill registry.\n# For standalone use:\nconst SB = require('./smart-backup.js');\n```\n\n## Commands\n\n```\n--backup <source> <destination>           Create full backup\n--backup --dry-run <source> <dest>        Preview backup\n--sync <source> <destination>             Sync files between locations\n--sync --dry-run <source> <dest>          Preview sync\n--verify <backup_file>                    Verify backup integrity\n--dedup <dir>                             Content-aware deduplication\n--list                                     List available backups\n--restore <backup_file> <destination>     Restore from backup\n--status                                   Backup status overview\n```\n\n## API\n\n### `createBackup(source, destination, dryRun = false)`\nCreate a timestamped gzip-compressed backup of source directory.\n\n```javascript\nSB.createBackup('/home/user/projects', '/backups', false);\n```\n\n### `createIncrementalBackup(source, destination, fromManifest, dryRun)`\nOnly back up files that changed since the last manifest.\n\n```javascript\nSB.createIncrementalBackup('/home/user/projects', '/backups');\n```\n\n### `syncFiles(source, destination, dryRun)`\nSynchronize files from source to destination.\n\n```javascript\nSB.syncFiles('/home/user/projects', '/backups/mirror');\n```\n\n### `verifyBackup(backupFile)`\nVerify backup integrity by comparing file hashes.\n\n```javascript\nSB.verifyBackup('/backups/backup-2026-07-18-123456789');\n```\n\n### `listBackups()`\nList all available timestamped backups.\n\n### `restoreBackup(backupFile, destination)`\nRestore a backup to the specified destination.\n\n```javascript\nSB.restoreBackup('/backups/backup-2026-07-18-123456789', '/home/user/restored');\n```\n\n### `findDuplicates()`\nFind and report duplicate files by content hash.\n\n### `getFileHash(filepath)`\nGet SHA-256 hash of a file. Returns null for missing files.\n\n### `formatBytes(bytes)`\nFormat byte count as human-readable string (`1 KB`, `2.5 MB`).\n\n### `collectFiles(dir, skipDirs)`\nRecursively collect files in a directory, skipping common non-essential dirs.\n\n### `showStatus()`\nPrint backup system status (total backups, size, directory).\n\n## Security\n\n- File hashes computed using SHA-256\n- Backup files stored with manifest for integrity verification\n- No external dependencies — pure Node.js crypto + zlib\n- Dry-run mode for safe preview before executing\n\n## Testing\n\n```bash\nnode tests/run-self-tests.js\n```\n\n### Test Coverage\n\n| Suite | Tests | Status |\n|---|---|---|\n| Self-tests (isolated) | 19 | ✅ Passing |\n\nFile v1.0.7:_meta.json\n\n{\n  \"ownerId\": \"kn7b6eyf5vc7khg5fr63pjm8xd82qvw5\",\n  \"slug\": \"backup-sync\",\n  \"version\": \"1.0.7\",\n  \"publishedAt\": 1784757188332\n}\n\nFile v1.0.7:skill-card.md\n\n## Description: <br>\nSmart Backup helps agents back up, sync, verify, deduplicate, and restore local files with manifest tracking and no external dependencies. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[jlacroix82](https://clawhub.ai/user/jlacroix82) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDevelopers, engineers, and agents use this skill to create and verify local backups, synchronize directories, find duplicate files, and restore data while previewing file-changing operations before execution. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Sync and restore operations can update destination files by design. <br>\nMitigation: Use dry-run before sync or restore, confirm source and destination paths, and require explicit force flags for deletion or overwrite behavior. <br>\nRisk: Backup manifests can expose local paths, filenames, and directory structure. <br>\nMitigation: Treat manifests as sensitive metadata and store backup directories only in access-controlled locations. <br>\n\n\n## Reference(s): <br>\n- [ClawHub skill page](https://clawhub.ai/jlacroix82/skills/backup-sync) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [text, shell commands, code, configuration, files, guidance] <br>\n**Output Format:** [Markdown guidance with inline shell commands and local file outputs] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [May create, modify, or restore local files and manifests; dry-run is recommended before file-changing operations.] <br>\n\n## Skill Version(s): <br>\n1.0.7 (source: server release evidence) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nFile v1.0.7:clawhub.yaml\n\nslug: backup-sync\nname: backup-sync\ndescription: Intelligent file backup with compression, manifest tracking, verification, and deduplication. ⚠️ Destructive restore/sync. Always dry-run first.\nversion: 1.0.5\ntype: skill\nauthor: OpenClaw\nlicense: MIT\nkeywords:\n  - backup\n  - sync\n  - deduplication\n  - compression\n  - agent\nentry: SKILL.md\nowner: jlacroix82\ndependencies: []\n\nArchive v1.0.6: 6 files, 11209 bytes\n\nFiles: clawhub.yaml (379b), README.md (3272b), skill-card.md (2597b), SKILL.md (7595b), smart-backup.js (19263b), _meta.json (130b)\n\nFile v1.0.6:SKILL.md\n\n---\nname: smart-backup\ndescription: Intelligent file backup with compression and verification. Backup, sync, verify integrity, dedup, and restore. Manifest tracking. Zero external dependencies.\n---\n\n# Smart Backup 💾\n\n**Stop losing config changes to disk failures. Start backing up intelligently.**\n\n## The Problem\n\nConfig 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.\n\nSmart Backup fixes this with automated backup, sync, verification, and deduplication.\n\n## ⚠️ Important Warnings\n\n### Destructive Restore / Sync\n- `--restore` overwrites target files with backup contents\n- `--sync` two-way merges can create conflicts\n- Both operations are irreversible if run without `--dry-run` first\nAlways preview with `--dry-run` before executing.\n\n### Silent Data Duplication\nIf 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.\n\n### Manifest Privacy\nBackup manifests (`manifest.json`) contain full file paths and sizes, which may reveal directory structure and filenames. Treat manifests as sensitive metadata.\n\n### Incremental Metadata Persistence\nThe backup journal and deduplication hash database persist under the backup destination. These files (`incremental-index.json`, `dedup-hashes.json`) grow with each backup run.\n\n## Safety\n\nThis version includes safety fixes for the three ClawHub security audit findings:\n\n### `--no-delete` — Default for sync (safe)\nBy default, sync **does not delete** files in the destination that are absent from the source. This prevents accidental data loss.\n\n- `--no-delete` (default): files in dest not in source are skipped and logged with a WARNING\n- `--delete`: enables deletion. Without `--force`, lists files that would be deleted but does not delete them\n- `--delete --force`: actually deletes files absent from source, logging each one\n\n### `--force` — Required for restore overwrite\n`--restore` **skips existing files by default** instead of silently overwriting them.\n\n- Without `--force`: existing files are skipped; WARNING logged for each\n- With `--force`: existing files are overwritten; OVERWRITE logged for each\n\n### Restore preserves directory structure\nRestore 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>`.\n\n### Tests excluded from published bundle\nThe `test/` and `tests/` directories are development artifacts and are **not included** in the published skill bundle.\n\n## Quick Start\n\n### Create a backup\n\n```bash\nnode skills/smart-backup/smart-backup.js --backup ~/openclaw /path/to/backup\n```\n\n### Preview backup without creating\n\n```bash\nnode skills/smart-backup/smart-backup.js --backup --dry-run ~/openclaw /path/to/backup\n```\n\n### Sync files between locations\n\n```bash\nnode skills/smart-backup/smart-backup.js --sync ~/openclaw /path/to/backup/sync\n```\n\nSyncs 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.\n\n### Preview sync\n\n```bash\nnode skills/smart-backup/smart-backup.js --sync --dry-run ~/openclaw /path/to/backup/sync\n```\n\n### Verify backup integrity\n\n```bash\nnode skills/smart-backup/smart-backup.js --verify /path/to/backup-xxx\n```\n\nChecks SHA-256 hashes of all files against manifest.\n\n### Find duplicate files\n\n```bash\nnode skills/smart-backup/smart-backup.js --dedup ~/openclaw\n```\n\nGroups files by content hash, shows sizes and paths.\n\n### List available backups\n\n```bash\nnode skills/smart-backup/smart-backup.js --list\n```\n\n### Restore from backup\n\n```bash\nnode skills/smart-backup/smart-backup.js --restore /path/to/backup-xxx /restore/path\n```\n\nRestores files preserving the original directory structure from the manifest. Existing destination files are **skipped** by default. Use `--force` to overwrite them.\n\n### Status overview\n\n```bash\nnode skills/smart-backup/smart-backup.js --status\n```\n\n### Incremental backup\n\n```bash\n# First backup (full)\nnode skills/smart-backup/smart-backup.js --backup /source /dest\n\n# Subsequent backups (only changed files)\nnode skills/smart-backup/smart-backup.js --backup /source /dest --incr\n```\n\nHash-based change detection — skips unchanged files for 10-100x speedup.\n\n## Features\n\n### Backup with Manifest\n\n- Creates timestamped backup directories\n- SHA-256 hash for every file in manifest\n- Total size and file count tracking\n- Skips `.git`, `node_modules`, `.cache`, `.npm` by default\n\n### Smart Sync\n\n- Copies new files, updates changed files, deletes extras\n- Hash-based change detection (not just timestamps)\n- Dry-run mode shows what would change before doing it\n\n### Integrity Verification\n\n- Verifies every file against stored SHA-256 hash\n- Reports missing files and hash mismatches\n- One-command verification of any backup\n\n### Incremental Backup\n\n- `--incr` flag enables hash-based change detection\n- Only backs up files that changed since last backup\n- Skips unchanged files (10-100x speedup)\n- Manifest tracks per-file SHA-256 hashes\n- `--from-manifest <id>` to base diff on specific manifest\n\n### Content-Aware Deduplication\n\n- Groups files by SHA-256 hash\n- Shows duplicate groups with sizes\n- Helps identify storage waste\n\n### Compression Ready\n\n- Manifest format supports compression (planned)\n- Estimated 60% compression savings shown in dry-run\n- Backup directory structure preserved\n\n## Configuration\n\nBackups stored in: `backups/smart-backups/`\n\nManifest stored in: `backups/smart-backups/manifest.json`\n\nOverride data directory:\n```bash\n--dir /path/to/data\n```\n\n## Agent Protocol\n\nDuring heartbeats and maintenance:\n\n1. **Weekly backup** — `--backup` your workspace to a safe location\n2. **Verify after backup** — `--verify` the latest backup\n3. **Dedup periodically** — `--dedup` to find and clean duplicates\n4. **List backups** — `--list` to check backup health\n5. **Dry-run first** — Always `--dry-run` before sync/backup on important dirs\n\n## Heartbeat Integration\n\nAdd to your `HEARTBEAT.md`:\n\n```markdown\n### 💾 Smart Backup\n\n- Weekly: `node skills/smart-backup/smart-backup.js --backup ~/openclaw /path/to/backup`\n- Verify: `node skills/smart-backup/smart-backup.js --verify <latest-backup>`\n- Dedup: `node skills/smart-backup/smart-backup.js --dedup ~/openclaw`\n```\n\n## Security Notes\n\n- File hashes are SHA-256 (integrity, not encryption)\n- Backups contain all file content — ensure backup storage is secure\n- Symlink-safe — uses standard fs operations\n- No network calls, all local\n\n## Comparison\n\n| Approach | Integrity Check | Dedup | Manifest | Automation |\n|----------|----------------|-------|----------|------------|\n| `cp -r` | ❌ | ❌ | ❌ | Manual |\n| `rsync` | ⚠️ | ❌ | ❌ | Auto |\n| **Smart Backup** | **✅** | **✅** | **✅** | **Auto** |\n\n**Smart Backup gives you integrity verification + dedup + manifest tracking in one tool.**\n\n## Design Principles\n\n1. **Zero setup** — Works immediately, no config needed\n2. **No dependencies** — Pure Node.js fs/crypto/zlib, no npm packages\n3. **Safe by default** — Skips known bloat directories, dry-run available\n4. **Transparent** — Every operation reports what it did\n5. **Persistent** — Manifests survive restarts and can verify integrity later\n\nFile v1.0.6:README.md\n\n# Smart Backup & Sync\n\nIntelligent file backup with gzip compression, incremental backups, verification, and deduplication.\n\n## Features\n\n- **Full Backups** — Create timestamped, compressed backups with manifest tracking\n- **Incremental Backups** — Only back up changed files since last manifest\n- **File Sync** — Sync files between directories with dry-run support\n- **Backup Verification** — Verify backup integrity (hash comparison)\n- **Restore** — Restore backups to a destination directory\n- **Deduplication** — Find duplicate files by content hash\n- **Status Overview** — View backup stats and storage health\n- **Compression** — Built-in gzip compression for backup files\n\n## Installation\n\n```bash\n# The skill is auto-loaded by OpenClaw via the skill registry.\n# For standalone use:\nconst SB = require('./smart-backup.js');\n```\n\n## Commands\n\n```\n--backup <source> <destination>           Create full backup\n--backup --dry-run <source> <dest>        Preview backup\n--sync <source> <destination>             Sync files between locations\n--sync --dry-run <source> <dest>          Preview sync\n--verify <backup_file>                    Verify backup integrity\n--dedup <dir>                             Content-aware deduplication\n--list                                     List available backups\n--restore <backup_file> <destination>     Restore from backup\n--status                                   Backup status overview\n```\n\n## API\n\n### `createBackup(source, destination, dryRun = false)`\nCreate a timestamped gzip-compressed backup of source directory.\n\n```javascript\nSB.createBackup('/home/user/projects', '/backups', false);\n```\n\n### `createIncrementalBackup(source, destination, fromManifest, dryRun)`\nOnly back up files that changed since the last manifest.\n\n```javascript\nSB.createIncrementalBackup('/home/user/projects', '/backups');\n```\n\n### `syncFiles(source, destination, dryRun)`\nSynchronize files from source to destination.\n\n```javascript\nSB.syncFiles('/home/user/projects', '/backups/mirror');\n```\n\n### `verifyBackup(backupFile)`\nVerify backup integrity by comparing file hashes.\n\n```javascript\nSB.verifyBackup('/backups/backup-2026-07-18-123456789');\n```\n\n### `listBackups()`\nList all available timestamped backups.\n\n### `restoreBackup(backupFile, destination)`\nRestore a backup to the specified destination.\n\n```javascript\nSB.restoreBackup('/backups/backup-2026-07-18-123456789', '/home/user/restored');\n```\n\n### `findDuplicates()`\nFind and report duplicate files by content hash.\n\n### `getFileHash(filepath)`\nGet SHA-256 hash of a file. Returns null for missing files.\n\n### `formatBytes(bytes)`\nFormat byte count as human-readable string (`1 KB`, `2.5 MB`).\n\n### `collectFiles(dir, skipDirs)`\nRecursively collect files in a directory, skipping common non-essential dirs.\n\n### `showStatus()`\nPrint backup system status (total backups, size, directory).\n\n## Security\n\n- File hashes computed using SHA-256\n- Backup files stored with manifest for integrity verification\n- No external dependencies — pure Node.js crypto + zlib\n- Dry-run mode for safe preview before executing\n\n## Testing\n\n```bash\nnode tests/run-self-tests.js\n```\n\n### Test Coverage\n\n| Suite | Tests | Status |\n|---|---|---|\n| Self-tests (isolated) | 19 | ✅ Passing |\n\nFile v1.0.6:_meta.json\n\n{\n  \"ownerId\": \"kn7b6eyf5vc7khg5fr63pjm8xd82qvw5\",\n  \"slug\": \"backup-sync\",\n  \"version\": \"1.0.6\",\n  \"publishedAt\": 1784757121626\n}\n\nFile v1.0.6:skill-card.md\n\n## Description: <br>\nIntelligent file backup with compression and verification, including backup, sync, integrity verification, deduplication, restore, and manifest tracking with zero external dependencies. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[jlacroix82](https://clawhub.ai/user/jlacroix82) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDevelopers and agents use this skill to create local file backups, synchronize directories, verify backup integrity, find duplicate files, and restore files from manifests. It is suited to workspace and configuration maintenance where dry-run review and careful path selection are part of the workflow. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: The skill has broad local filesystem access for user-selected backup, sync, and restore paths. <br>\nMitigation: Use it only on directories selected intentionally, run dry-run before changing important paths, and review source and destination paths before execution. <br>\nRisk: Sync deletion and forced restore overwrite can destroy or replace local files. <br>\nMitigation: Avoid --delete --force and restore --force unless dry-run output and target paths have been checked carefully. <br>\nRisk: Backup folders and manifests may contain plaintext file contents and sensitive path metadata. <br>\nMitigation: Store backup directories and manifests in protected locations with appropriate access controls. <br>\nRisk: Persistent backup metadata may accumulate over time. <br>\nMitigation: Periodically audit backup folders, manifests, and hash databases for stale, duplicate, or sensitive entries. <br>\n\n\n## Reference(s): <br>\n- [ClawHub skill page](https://clawhub.ai/jlacroix82/skills/backup-sync) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [Shell commands, Code, Configuration, Guidance] <br>\n**Output Format:** [Markdown with inline shell commands and JavaScript API examples] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Produces local filesystem backup, sync, restore, verification, deduplication, manifest, and status outputs; no network behavior is reported in server security evidence.] <br>\n\n## Skill Version(s): <br>\n1.0.6 (source: server release evidence) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nFile v1.0.6:clawhub.yaml\n\nslug: backup-sync\nname: backup-sync\ndescription: Intelligent file backup with compression, manifest tracking, verification, and deduplication. ⚠️ Destructive restore/sync. Always dry-run first.\nversion: 1.0.5\ntype: skill\nauthor: OpenClaw\nlicense: MIT\nkeywords:\n  - backup\n  - sync\n  - deduplication\n  - compression\n  - agent\nentry: SKILL.md\nowner: jlacroix82\ndependencies: []\n\nArchive v1.0.5: 6 files, 11206 bytes\n\nFiles: clawhub.yaml (379b), README.md (3272b), skill-card.md (2569b), SKILL.md (7595b), smart-backup.js (19263b), _meta.json (130b)\n\nFile v1.0.5:SKILL.md\n\n---\nname: smart-backup\ndescription: Intelligent file backup with compression and verification. Backup, sync, verify integrity, dedup, and restore. Manifest tracking. Zero external dependencies.\n---\n\n# Smart Backup 💾\n\n**Stop losing config changes to disk failures. Start backing up intelligently.**\n\n## The Problem\n\nConfig 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.\n\nSmart Backup fixes this with automated backup, sync, verification, and deduplication.\n\n## ⚠️ Important Warnings\n\n### Destructive Restore / Sync\n- `--restore` overwrites target files with backup contents\n- `--sync` two-way merges can create conflicts\n- Both operations are irreversible if run without `--dry-run` first\nAlways preview with `--dry-run` before executing.\n\n### Silent Data Duplication\nIf 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.\n\n### Manifest Privacy\nBackup manifests (`manifest.json`) contain full file paths and sizes, which may reveal directory structure and filenames. Treat manifests as sensitive metadata.\n\n### Incremental Metadata Persistence\nThe backup journal and deduplication hash database persist under the backup destination. These files (`incremental-index.json`, `dedup-hashes.json`) grow with each backup run.\n\n## Safety\n\nThis version includes safety fixes for the three ClawHub security audit findings:\n\n### `--no-delete` — Default for sync (safe)\nBy default, sync **does not delete** files in the destination that are absent from the source. This prevents accidental data loss.\n\n- `--no-delete` (default): files in dest not in source are skipped and logged with a WARNING\n- `--delete`: enables deletion. Without `--force`, lists files that would be deleted but does not delete them\n- `--delete --force`: actually deletes files absent from source, logging each one\n\n### `--force` — Required for restore overwrite\n`--restore` **skips existing files by default** instead of silently overwriting them.\n\n- Without `--force`: existing files are skipped; WARNING logged for each\n- With `--force`: existing files are overwritten; OVERWRITE logged for each\n\n### Restore preserves directory structure\nRestore 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>`.\n\n### Tests excluded from published bundle\nThe `test/` and `tests/` directories are development artifacts and are **not included** in the published skill bundle.\n\n## Quick Start\n\n### Create a backup\n\n```bash\nnode skills/smart-backup/smart-backup.js --backup ~/openclaw /path/to/backup\n```\n\n### Preview backup without creating\n\n```bash\nnode skills/smart-backup/smart-backup.js --backup --dry-run ~/openclaw /path/to/backup\n```\n\n### Sync files between locations\n\n```bash\nnode skills/smart-backup/smart-backup.js --sync ~/openclaw /path/to/backup/sync\n```\n\nSyncs 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.\n\n### Preview sync\n\n```bash\nnode skills/smart-backup/smart-backup.js --sync --dry-run ~/openclaw /path/to/backup/sync\n```\n\n### Verify backup integrity\n\n```bash\nnode skills/smart-backup/smart-backup.js --verify /path/to/backup-xxx\n```\n\nChecks SHA-256 hashes of all files against manifest.\n\n### Find duplicate files\n\n```bash\nnode skills/smart-backup/smart-backup.js --dedup ~/openclaw\n```\n\nGroups files by content hash, shows sizes and paths.\n\n### List available backups\n\n```bash\nnode skills/smart-backup/smart-backup.js --list\n```\n\n### Restore from backup\n\n```bash\nnode skills/smart-backup/smart-backup.js --restore /path/to/backup-xxx /restore/path\n```\n\nRestores files preserving the original directory structure from the manifest. Existing destination files are **skipped** by default. Use `--force` to overwrite them.\n\n### Status overview\n\n```bash\nnode skills/smart-backup/smart-backup.js --status\n```\n\n### Incremental backup\n\n```bash\n# First backup (full)\nnode skills/smart-backup/smart-backup.js --backup /source /dest\n\n# Subsequent backups (only changed files)\nnode skills/smart-backup/smart-backup.js --backup /source /dest --incr\n```\n\nHash-based change detection — skips unchanged files for 10-100x speedup.\n\n## Features\n\n### Backup with Manifest\n\n- Creates timestamped backup directories\n- SHA-256 hash for every file in manifest\n- Total size and file count tracking\n- Skips `.git`, `node_modules`, `.cache`, `.npm` by default\n\n### Smart Sync\n\n- Copies new files, updates changed files, deletes extras\n- Hash-based change detection (not just timestamps)\n- Dry-run mode shows what would change before doing it\n\n### Integrity Verification\n\n- Verifies every file against stored SHA-256 hash\n- Reports missing files and hash mismatches\n- One-command verification of any backup\n\n### Incremental Backup\n\n- `--incr` flag enables hash-based change detection\n- Only backs up files that changed since last backup\n- Skips unchanged files (10-100x speedup)\n- Manifest tracks per-file SHA-256 hashes\n- `--from-manifest <id>` to base diff on specific manifest\n\n### Content-Aware Deduplication\n\n- Groups files by SHA-256 hash\n- Shows duplicate groups with sizes\n- Helps identify storage waste\n\n### Compression Ready\n\n- Manifest format supports compression (planned)\n- Estimated 60% compression savings shown in dry-run\n- Backup directory structure preserved\n\n## Configuration\n\nBackups stored in: `backups/smart-backups/`\n\nManifest stored in: `backups/smart-backups/manifest.json`\n\nOverride data directory:\n```bash\n--dir /path/to/data\n```\n\n## Agent Protocol\n\nDuring heartbeats and maintenance:\n\n1. **Weekly backup** — `--backup` your workspace to a safe location\n2. **Verify after backup** — `--verify` the latest backup\n3. **Dedup periodically** — `--dedup` to find and clean duplicates\n4. **List backups** — `--list` to check backup health\n5. **Dry-run first** — Always `--dry-run` before sync/backup on important dirs\n\n## Heartbeat Integration\n\nAdd to your `HEARTBEAT.md`:\n\n```markdown\n### 💾 Smart Backup\n\n- Weekly: `node skills/smart-backup/smart-backup.js --backup ~/openclaw /path/to/backup`\n- Verify: `node skills/smart-backup/smart-backup.js --verify <latest-backup>`\n- Dedup: `node skills/smart-backup/smart-backup.js --dedup ~/openclaw`\n```\n\n## Security Notes\n\n- File hashes are SHA-256 (integrity, not encryption)\n- Backups contain all file content — ensure backup storage is secure\n- Symlink-safe — uses standard fs operations\n- No network calls, all local\n\n## Comparison\n\n| Approach | Integrity Check | Dedup | Manifest | Automation |\n|----------|----------------|-------|----------|------------|\n| `cp -r` | ❌ | ❌ | ❌ | Manual |\n| `rsync` | ⚠️ | ❌ | ❌ | Auto |\n| **Smart Backup** | **✅** | **✅** | **✅** | **Auto** |\n\n**Smart Backup gives you integrity verification + dedup + manifest tracking in one tool.**\n\n## Design Principles\n\n1. **Zero setup** — Works immediately, no config needed\n2. **No dependencies** — Pure Node.js fs/crypto/zlib, no npm packages\n3. **Safe by default** — Skips known bloat directories, dry-run available\n4. **Transparent** — Every operation reports what it did\n5. **Persistent** — Manifests survive restarts and can verify integrity later\n\nFile v1.0.5:README.md\n\n# Smart Backup & Sync\n\nIntelligent file backup with gzip compression, incremental backups, verification, and deduplication.\n\n## Features\n\n- **Full Backups** — Create timestamped, compressed backups with manifest tracking\n- **Incremental Backups** — Only back up changed files since last manifest\n- **File Sync** — Sync files between directories with dry-run support\n- **Backup Verification** — Verify backup integrity (hash comparison)\n- **Restore** — Restore backups to a destination directory\n- **Deduplication** — Find duplicate files by content hash\n- **Status Overview** — View backup stats and storage health\n- **Compression** — Built-in gzip compression for backup files\n\n## Installation\n\n```bash\n# The skill is auto-loaded by OpenClaw via the skill registry.\n# For standalone use:\nconst SB = require('./smart-backup.js');\n```\n\n## Commands\n\n```\n--backup <source> <destination>           Create full backup\n--backup --dry-run <source> <dest>        Preview backup\n--sync <source> <destination>             Sync files between locations\n--sync --dry-run <source> <dest>          Preview sync\n--verify <backup_file>                    Verify backup integrity\n--dedup <dir>                             Content-aware deduplication\n--list                                     List available backups\n--restore <backup_file> <destination>     Restore from backup\n--status                                   Backup status overview\n```\n\n## API\n\n### `createBackup(source, destination, dryRun = false)`\nCreate a timestamped gzip-compressed backup of source directory.\n\n```javascript\nSB.createBackup('/home/user/projects', '/backups', false);\n```\n\n### `createIncrementalBackup(source, destination, fromManifest, dryRun)`\nOnly back up files that changed since the last manifest.\n\n```javascript\nSB.createIncrementalBackup('/home/user/projects', '/backups');\n```\n\n### `syncFiles(source, destination, dryRun)`\nSynchronize files from source to destination.\n\n```javascript\nSB.syncFiles('/home/user/projects', '/backups/mirror');\n```\n\n### `verifyBackup(backupFile)`\nVerify backup integrity by comparing file hashes.\n\n```javascript\nSB.verifyBackup('/backups/backup-2026-07-18-123456789');\n```\n\n### `listBackups()`\nList all available timestamped backups.\n\n### `restoreBackup(backupFile, destination)`\nRestore a backup to the specified destination.\n\n```javascript\nSB.restoreBackup('/backups/backup-2026-07-18-123456789', '/home/user/restored');\n```\n\n### `findDuplicates()`\nFind and report duplicate files by content hash.\n\n### `getFileHash(filepath)`\nGet SHA-256 hash of a file. Returns null for missing files.\n\n### `formatBytes(bytes)`\nFormat byte count as human-readable string (`1 KB`, `2.5 MB`).\n\n### `collectFiles(dir, skipDirs)`\nRecursively collect files in a directory, skipping common non-essential dirs.\n\n### `showStatus()`\nPrint backup system status (total backups, size, directory).\n\n## Security\n\n- File hashes computed using SHA-256\n- Backup files stored with manifest for integrity verification\n- No external dependencies — pure Node.js crypto + zlib\n- Dry-run mode for safe preview before executing\n\n## Testing\n\n```bash\nnode tests/run-self-tests.js\n```\n\n### Test Coverage\n\n| Suite | Tests | Status |\n|---|---|---|\n| Self-tests (isolated) | 19 | ✅ Passing |\n\nFile v1.0.5:_meta.json\n\n{\n  \"ownerId\": \"kn7b6eyf5vc7khg5fr63pjm8xd82qvw5\",\n  \"slug\": \"backup-sync\",\n  \"version\": \"1.0.5\",\n  \"publishedAt\": 1784757073091\n}\n\nFile v1.0.5:skill-card.md\n\n## Description: <br>\nIntelligent local file backup and sync with integrity verification, deduplication, restore support, manifest tracking, and zero external dependencies. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[jlacroix82](https://clawhub.ai/user/jlacroix82) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDevelopers, operators, and agent maintainers use Smart Backup to create and verify local backups, sync directories, identify duplicates, and restore files while previewing changes before destructive operations. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: The skill needs broad local file access to directories selected for backup, sync, restore, or deduplication. <br>\nMitigation: Grant access only to intended directories and run with --dry-run before operations on important paths. <br>\nRisk: Sync and restore modes can change existing files, including overwrite or delete behavior when explicit flags are used. <br>\nMitigation: Review dry-run output first, keep --no-delete as the sync default unless deletion is intended, and use --force only after confirming overwrite or delete targets. <br>\nRisk: Backup manifests and incremental metadata can expose full paths, filenames, sizes, and backup history. <br>\nMitigation: Treat manifest and hash database files as sensitive metadata and store backups in locations with appropriate access controls. <br>\nRisk: Restoring from untrusted or manually edited backup manifests can place unexpected files into the destination. <br>\nMitigation: Restore only from trusted backups and verify backup integrity before restoring. <br>\n\n\n## Reference(s): <br>\n- [Smart Backup ClawHub Listing](https://clawhub.ai/jlacroix82/skills/backup-sync) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [text, shell commands, configuration, guidance, files] <br>\n**Output Format:** [Markdown guidance with inline shell commands and CLI text output] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [May create, overwrite, delete, or restore local files when invoked without dry-run depending on selected flags.] <br>\n\n## Skill Version(s): <br>\n1.0.5 (source: server release evidence and clawhub.yaml) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nFile v1.0.5:clawhub.yaml\n\nslug: backup-sync\nname: backup-sync\ndescription: Intelligent file backup with compression, manifest tracking, verification, and deduplication. ⚠️ Destructive restore/sync. Always dry-run first.\nversion: 1.0.5\ntype: skill\nauthor: OpenClaw\nlicense: MIT\nkeywords:\n  - backup\n  - sync\n  - deduplication\n  - compression\n  - agent\nentry: SKILL.md\nowner: jlacroix82\ndependencies: []\n\nArchive v1.0.4: 8 files, 12363 bytes\n\nFiles: clawhub.yaml (379b), README.md (3272b), skill-card.md (2155b), SKILL.md (6000b), smart-backup.js (17435b), test/run-tests.js (1009b), tests/run-self-tests.js (8116b), _meta.json (130b)\n\nFile v1.0.4:SKILL.md\n\n---\nname: smart-backup\ndescription: Intelligent file backup with compression and verification. Backup, sync, verify integrity, dedup, and restore. Manifest tracking. Zero external dependencies.\n---\n\n# Smart Backup 💾\n\n**Stop losing config changes to disk failures. Start backing up intelligently.**\n\n## The Problem\n\nConfig 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.\n\nSmart Backup fixes this with automated backup, sync, verification, and deduplication.\n\n## ⚠️ Important Warnings\n\n### Destructive Restore / Sync\n- `--restore` overwrites target files with backup contents\n- `--sync` two-way merges can create conflicts\n- Both operations are irreversible if run without `--dry-run` first\nAlways preview with `--dry-run` before executing.\n\n### Silent Data Duplication\nIf 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.\n\n### Manifest Privacy\nBackup manifests (`manifest.json`) contain full file paths and sizes, which may reveal directory structure and filenames. Treat manifests as sensitive metadata.\n\n### Incremental Metadata Persistence\nThe backup journal and deduplication hash database persist under the backup destination. These files (`incremental-index.json`, `dedup-hashes.json`) grow with each backup run.\n\n## Quick Start\n\n### Create a backup\n\n```bash\nnode skills/smart-backup/smart-backup.js --backup ~/openclaw /path/to/backup\n```\n\n### Preview backup without creating\n\n```bash\nnode skills/smart-backup/smart-backup.js --backup --dry-run ~/openclaw /path/to/backup\n```\n\n### Sync files between locations\n\n```bash\nnode skills/smart-backup/smart-backup.js --sync ~/openclaw /path/to/backup/sync\n```\n\nSyncs only changed files, deletes extras in destination.\n\n### Preview sync\n\n```bash\nnode skills/smart-backup/smart-backup.js --sync --dry-run ~/openclaw /path/to/backup/sync\n```\n\n### Verify backup integrity\n\n```bash\nnode skills/smart-backup/smart-backup.js --verify /path/to/backup-xxx\n```\n\nChecks SHA-256 hashes of all files against manifest.\n\n### Find duplicate files\n\n```bash\nnode skills/smart-backup/smart-backup.js --dedup ~/openclaw\n```\n\nGroups files by content hash, shows sizes and paths.\n\n### List available backups\n\n```bash\nnode skills/smart-backup/smart-backup.js --list\n```\n\n### Restore from backup\n\n```bash\nnode skills/smart-backup/smart-backup.js --restore /path/to/backup-xxx /restore/path\n```\n\n### Status overview\n\n```bash\nnode skills/smart-backup/smart-backup.js --status\n```\n\n### Incremental backup\n\n```bash\n# First backup (full)\nnode skills/smart-backup/smart-backup.js --backup /source /dest\n\n# Subsequent backups (only changed files)\nnode skills/smart-backup/smart-backup.js --backup /source /dest --incr\n```\n\nHash-based change detection — skips unchanged files for 10-100x speedup.\n\n## Features\n\n### Backup with Manifest\n\n- Creates timestamped backup directories\n- SHA-256 hash for every file in manifest\n- Total size and file count tracking\n- Skips `.git`, `node_modules`, `.cache`, `.npm` by default\n\n### Smart Sync\n\n- Copies new files, updates changed files, deletes extras\n- Hash-based change detection (not just timestamps)\n- Dry-run mode shows what would change before doing it\n\n### Integrity Verification\n\n- Verifies every file against stored SHA-256 hash\n- Reports missing files and hash mismatches\n- One-command verification of any backup\n\n### Incremental Backup\n\n- `--incr` flag enables hash-based change detection\n- Only backs up files that changed since last backup\n- Skips unchanged files (10-100x speedup)\n- Manifest tracks per-file SHA-256 hashes\n- `--from-manifest <id>` to base diff on specific manifest\n\n### Content-Aware Deduplication\n\n- Groups files by SHA-256 hash\n- Shows duplicate groups with sizes\n- Helps identify storage waste\n\n### Compression Ready\n\n- Manifest format supports compression (planned)\n- Estimated 60% compression savings shown in dry-run\n- Backup directory structure preserved\n\n## Configuration\n\nBackups stored in: `backups/smart-backups/`\n\nManifest stored in: `backups/smart-backups/manifest.json`\n\nOverride data directory:\n```bash\n--dir /path/to/data\n```\n\n## Agent Protocol\n\nDuring heartbeats and maintenance:\n\n1. **Weekly backup** — `--backup` your workspace to a safe location\n2. **Verify after backup** — `--verify` the latest backup\n3. **Dedup periodically** — `--dedup` to find and clean duplicates\n4. **List backups** — `--list` to check backup health\n5. **Dry-run first** — Always `--dry-run` before sync/backup on important dirs\n\n## Heartbeat Integration\n\nAdd to your `HEARTBEAT.md`:\n\n```markdown\n### 💾 Smart Backup\n\n- Weekly: `node skills/smart-backup/smart-backup.js --backup ~/openclaw /path/to/backup`\n- Verify: `node skills/smart-backup/smart-backup.js --verify <latest-backup>`\n- Dedup: `node skills/smart-backup/smart-backup.js --dedup ~/openclaw`\n```\n\n## Security Notes\n\n- File hashes are SHA-256 (integrity, not encryption)\n- Backups contain all file content — ensure backup storage is secure\n- Symlink-safe — uses standard fs operations\n- No network calls, all local\n\n## Comparison\n\n| Approach | Integrity Check | Dedup | Manifest | Automation |\n|----------|----------------|-------|----------|------------|\n| `cp -r` | ❌ | ❌ | ❌ | Manual |\n| `rsync` | ⚠️ | ❌ | ❌ | Auto |\n| **Smart Backup** | **✅** | **✅** | **✅** | **Auto** |\n\n**Smart Backup gives you integrity verification + dedup + manifest tracking in one tool.**\n\n## Design Principles\n\n1. **Zero setup** — Works immediately, no config needed\n2. **No dependencies** — Pure Node.js fs/crypto/zlib, no npm packages\n3. **Safe by default** — Skips known bloat directories, dry-run available\n4. **Transparent** — Every operation reports what it did\n5. **Persistent** — Manifests survive restarts and can verify integrity later\n\nFile v1.0.4:README.md\n\n# Smart Backup & Sync\n\nIntelligent file backup with gzip compression, incremental backups, verification, and deduplication.\n\n## Features\n\n- **Full Backups** — Create timestamped, compressed backups with manifest tracking\n- **Incremental Backups** — Only back up changed files since last manifest\n- **File Sync** — Sync files between directories with dry-run support\n- **Backup Verification** — Verify backup integrity (hash comparison)\n- **Restore** — Restore backups to a destination directory\n- **Deduplication** — Find duplicate files by content hash\n- **Status Overview** — View backup stats and storage health\n- **Compression** — Built-in gzip compression for backup files\n\n## Installation\n\n```bash\n# The skill is auto-loaded by OpenClaw via the skill registry.\n# For standalone use:\nconst SB = require('./smart-backup.js');\n```\n\n## Commands\n\n```\n--backup <source> <destination>           Create full backup\n--backup --dry-run <source> <dest>        Preview backup\n--sync <source> <destination>             Sync files between locations\n--sync --dry-run <source> <dest>          Preview sync\n--verify <backup_file>                    Verify backup integrity\n--dedup <dir>                             Content-aware deduplication\n--list                                     List available backups\n--restore <backup_file> <destination>     Restore from backup\n--status                                   Backup status overview\n```\n\n## API\n\n### `createBackup(source, destination, dryRun = false)`\nCreate a timestamped gzip-compressed backup of source directory.\n\n```javascript\nSB.createBackup('/home/user/projects', '/backups', false);\n```\n\n### `createIncrementalBackup(source, destination, fromManifest, dryRun)`\nOnly back up files that changed since the last manifest.\n\n```javascript\nSB.createIncrementalBackup('/home/user/projects', '/backups');\n```\n\n### `syncFiles(source, destination, dryRun)`\nSynchronize files from source to destination.\n\n```javascript\nSB.syncFiles('/home/user/projects', '/backups/mirror');\n```\n\n### `verifyBackup(backupFile)`\nVerify backup integrity by comparing file hashes.\n\n```javascript\nSB.verifyBackup('/backups/backup-2026-07-18-123456789');\n```\n\n### `listBackups()`\nList all available timestamped backups.\n\n### `restoreBackup(backupFile, destination)`\nRestore a backup to the specified destination.\n\n```javascript\nSB.restoreBackup('/backups/backup-2026-07-18-123456789', '/home/user/restored');\n```\n\n### `findDuplicates()`\nFind and report duplicate files by content hash.\n\n### `getFileHash(filepath)`\nGet SHA-256 hash of a file. Returns null for missing files.\n\n### `formatBytes(bytes)`\nFormat byte count as human-readable string (`1 KB`, `2.5 MB`).\n\n### `collectFiles(dir, skipDirs)`\nRecursively collect files in a directory, skipping common non-essential dirs.\n\n### `showStatus()`\nPrint backup system status (total backups, size, directory).\n\n## Security\n\n- File hashes computed using SHA-256\n- Backup files stored with manifest for integrity verification\n- No external dependencies — pure Node.js crypto + zlib\n- Dry-run mode for safe preview before executing\n\n## Testing\n\n```bash\nnode tests/run-self-tests.js\n```\n\n### Test Coverage\n\n| Suite | Tests | Status |\n|---|---|---|\n| Self-tests (isolated) | 19 | ✅ Passing |\n\nFile v1.0.4:_meta.json\n\n{\n  \"ownerId\": \"kn7b6eyf5vc7khg5fr63pjm8xd82qvw5\",\n  \"slug\": \"backup-sync\",\n  \"version\": \"1.0.4\",\n  \"publishedAt\": 1784737588944\n}\n\nFile v1.0.4:skill-card.md\n\n## Description: <br>\nIntelligent file backup with compression and verification. Backup, sync, verify integrity, dedup, and restore. Manifest tracking. Zero external dependencies. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[jlacroix82](https://clawhub.ai/user/jlacroix82) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDevelopers and operators use Smart Backup to create local backups, sync directories, verify integrity, restore files, and identify duplicates for agent workspaces and configuration files. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Sync and restore operations can delete destination-only files or overwrite existing files. <br>\nMitigation: Run with --dry-run first, verify source and destination paths, and restore into a staging directory when possible. <br>\nRisk: Backups contain copied file contents, and manifests can expose full paths, file names, and sizes. <br>\nMitigation: Store backup directories securely and treat manifest files as sensitive metadata. <br>\nRisk: Incremental journals and deduplication hash data persist under the backup destination and can grow over time. <br>\nMitigation: Audit backup storage periodically and apply retention cleanup appropriate to the workspace. <br>\n\n\n## Reference(s): <br>\n- [ClawHub Skill Page](https://clawhub.ai/jlacroix82/skills/backup-sync) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [Shell commands, Configuration instructions, Guidance] <br>\n**Output Format:** [Markdown with inline bash code blocks] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Guidance may direct local backup, sync, restore, deduplication, verification, and manifest operations.] <br>\n\n## Skill Version(s): <br>\n1.0.4 (source: server release evidence and clawhub.yaml) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nFile v1.0.4:clawhub.yaml\n\nslug: backup-sync\nname: backup-sync\ndescription: Intelligent file backup with compression, manifest tracking, verification, and deduplication. ⚠️ Destructive restore/sync. Always dry-run first.\nversion: 1.0.4\ntype: skill\nauthor: OpenClaw\nlicense: MIT\nkeywords:\n  - backup\n  - sync\n  - deduplication\n  - compression\n  - agent\nentry: SKILL.md\nowner: jlacroix82\ndependencies: []\n\nArchive v1.0.2: 8 files, 12406 bytes\n\nFiles: clawhub.yaml (379b), README.md (3272b), skill-card.md (2271b), SKILL.md (6000b), smart-backup.js (17435b), test/run-tests.js (1009b), tests/run-self-tests.js (8116b), _meta.json (130b)\n\nFile v1.0.2:SKILL.md\n\n---\nname: smart-backup\ndescription: Intelligent file backup with compression and verification. Backup, sync, verify integrity, dedup, and restore. Manifest tracking. Zero external dependencies.\n---\n\n# Smart Backup 💾\n\n**Stop losing config changes to disk failures. Start backing up intelligently.**\n\n## The Problem\n\nConfig 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.\n\nSmart Backup fixes this with automated backup, sync, verification, and deduplication.\n\n## ⚠️ Important Warnings\n\n### Destructive Restore / Sync\n- `--restore` overwrites target files with backup contents\n- `--sync` two-way merges can create conflicts\n- Both operations are irreversible if run without `--dry-run` first\nAlways preview with `--dry-run` before executing.\n\n### Silent Data Duplication\nIf 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.\n\n### Manifest Privacy\nBackup manifests (`manifest.json`) contain full file paths and sizes, which may reveal directory structure and filenames. Treat manifests as sensitive metadata.\n\n### Incremental Metadata Persistence\nThe backup journal and deduplication hash database persist under the backup destination. These files (`incremental-index.json`, `dedup-hashes.json`) grow with each backup run.\n\n## Quick Start\n\n### Create a backup\n\n```bash\nnode skills/smart-backup/smart-backup.js --backup ~/openclaw /path/to/backup\n```\n\n### Preview backup without creating\n\n```bash\nnode skills/smart-backup/smart-backup.js --backup --dry-run ~/openclaw /path/to/backup\n```\n\n### Sync files between locations\n\n```bash\nnode skills/smart-backup/smart-backup.js --sync ~/openclaw /path/to/backup/sync\n```\n\nSyncs only changed files, deletes extras in destination.\n\n### Preview sync\n\n```bash\nnode skills/smart-backup/smart-backup.js --sync --dry-run ~/openclaw /path/to/backup/sync\n```\n\n### Verify backup integrity\n\n```bash\nnode skills/smart-backup/smart-backup.js --verify /path/to/backup-xxx\n```\n\nChecks SHA-256 hashes of all files against manifest.\n\n### Find duplicate files\n\n```bash\nnode skills/smart-backup/smart-backup.js --dedup ~/openclaw\n```\n\nGroups files by content hash, shows sizes and paths.\n\n### List available backups\n\n```bash\nnode skills/smart-backup/smart-backup.js --list\n```\n\n### Restore from backup\n\n```bash\nnode skills/smart-backup/smart-backup.js --restore /path/to/backup-xxx /restore/path\n```\n\n### Status overview\n\n```bash\nnode skills/smart-backup/smart-backup.js --status\n```\n\n### Incremental backup\n\n```bash\n# First backup (full)\nnode skills/smart-backup/smart-backup.js --backup /source /dest\n\n# Subsequent backups (only changed files)\nnode skills/smart-backup/smart-backup.js --backup /source /dest --incr\n```\n\nHash-based change detection — skips unchanged files for 10-100x speedup.\n\n## Features\n\n### Backup with Manifest\n\n- Creates timestamped backup directories\n- SHA-256 hash for every file in manifest\n- Total size and file count tracking\n- Skips `.git`, `node_modules`, `.cache`, `.npm` by default\n\n### Smart Sync\n\n- Copies new files, updates changed files, deletes extras\n- Hash-based change detection (not just timestamps)\n- Dry-run mode shows what would change before doing it\n\n### Integrity Verification\n\n- Verifies every file against stored SHA-256 hash\n- Reports missing files and hash mismatches\n- One-command verification of any backup\n\n### Incremental Backup\n\n- `--incr` flag enables hash-based change detection\n- Only backs up files that changed since last backup\n- Skips unchanged files (10-100x speedup)\n- Manifest tracks per-file SHA-256 hashes\n- `--from-manifest <id>` to base diff on specific manifest\n\n### Content-Aware Deduplication\n\n- Groups files by SHA-256 hash\n- Shows duplicate groups with sizes\n- Helps identify storage waste\n\n### Compression Ready\n\n- Manifest format supports compression (planned)\n- Estimated 60% compression savings shown in dry-run\n- Backup directory structure preserved\n\n## Configuration\n\nBackups stored in: `backups/smart-backups/`\n\nManifest stored in: `backups/smart-backups/manifest.json`\n\nOverride data directory:\n```bash\n--dir /path/to/data\n```\n\n## Agent Protocol\n\nDuring heartbeats and maintenance:\n\n1. **Weekly backup** — `--backup` your workspace to a safe location\n2. **Verify after backup** — `--verify` the latest backup\n3. **Dedup periodically** — `--dedup` to find and clean duplicates\n4. **List backups** — `--list` to check backup health\n5. **Dry-run first** — Always `--dry-run` before sync/backup on important dirs\n\n## Heartbeat Integration\n\nAdd to your `HEARTBEAT.md`:\n\n```markdown\n### 💾 Smart Backup\n\n- Weekly: `node skills/smart-backup/smart-backup.js --backup ~/openclaw /path/to/backup`\n- Verify: `node skills/smart-backup/smart-backup.js --verify <latest-backup>`\n- Dedup: `node skills/smart-backup/smart-backup.js --dedup ~/openclaw`\n```\n\n## Security Notes\n\n- File hashes are SHA-256 (integrity, not encryption)\n- Backups contain all file content — ensure backup storage is secure\n- Symlink-safe — uses standard fs operations\n- No network calls, all local\n\n## Comparison\n\n| Approach | Integrity Check | Dedup | Manifest | Automation |\n|----------|----------------|-------|----------|------------|\n| `cp -r` | ❌ | ❌ | ❌ | Manual |\n| `rsync` | ⚠️ | ❌ | ❌ | Auto |\n| **Smart Backup** | **✅** | **✅** | **✅** | **Auto** |\n\n**Smart Backup gives you integrity verification + dedup + manifest tracking in one tool.**\n\n## Design Principles\n\n1. **Zero setup** — Works immediately, no config needed\n2. **No dependencies** — Pure Node.js fs/crypto/zlib, no npm packages\n3. **Safe by default** — Skips known bloat directories, dry-run available\n4. **Transparent** — Every operation reports what it did\n5. **Persistent** — Manifests survive restarts and can verify integrity later\n\nFile v1.0.2:README.md\n\n# Smart Backup & Sync\n\nIntelligent file backup with gzip compression, incremental backups, verification, and deduplication.\n\n## Features\n\n- **Full Backups** — Create timestamped, compressed backups with manifest tracking\n- **Incremental Backups** — Only back up changed files since last manifest\n- **File Sync** — Sync files between directories with dry-run support\n- **Backup Verification** — Verify backup integrity (hash comparison)\n- **Restore** — Restore backups to a destination directory\n- **Deduplication** — Find duplicate files by content hash\n- **Status Overview** — View backup stats and storage health\n- **Compression** — Built-in gzip compression for backup files\n\n## Installation\n\n```bash\n# The skill is auto-loaded by OpenClaw via the skill registry.\n# For standalone use:\nconst SB = require('./smart-backup.js');\n```\n\n## Commands\n\n```\n--backup <source> <destination>           Create full backup\n--backup --dry-run <source> <dest>        Preview backup\n--sync <source> <destination>             Sync files between locations\n--sync --dry-run <source> <dest>          Preview sync\n--verify <backup_file>                    Verify backup integrity\n--dedup <dir>                             Content-aware deduplication\n--list                                     List available backups\n--restore <backup_file> <destination>     Restore from backup\n--status                                   Backup status overview\n```\n\n## API\n\n### `createBackup(source, destination, dryRun = false)`\nCreate a timestamped gzip-compressed backup of source directory.\n\n```javascript\nSB.createBackup('/home/user/projects', '/backups', false);\n```\n\n### `createIncrementalBackup(source, destination, fromManifest, dryRun)`\nOnly back up files that changed since the last manifest.\n\n```javascript\nSB.createIncrementalBackup('/home/user/projects', '/backups');\n```\n\n### `syncFiles(source, destination, dryRun)`\nSynchronize files from source to destination.\n\n```javascript\nSB.syncFiles('/home/user/projects', '/backups/mirror');\n```\n\n### `verifyBackup(backupFile)`\nVerify backup integrity by comparing file hashes.\n\n```javascript\nSB.verifyBackup('/backups/backup-2026-07-18-123456789');\n```\n\n### `listBackups()`\nList all available timestamped backups.\n\n### `restoreBackup(backupFile, destination)`\nRestore a backup to the specified destination.\n\n```javascript\nSB.restoreBackup('/backups/backup-2026-07-18-123456789', '/home/user/restored');\n```\n\n### `findDuplicates()`\nFind and report duplicate files by content hash.\n\n### `getFileHash(filepath)`\nGet SHA-256 hash of a file. Returns null for missing files.\n\n### `formatBytes(bytes)`\nFormat byte count as human-readable string (`1 KB`, `2.5 MB`).\n\n### `collectFiles(dir, skipDirs)`\nRecursively collect files in a directory, skipping common non-essential dirs.\n\n### `showStatus()`\nPrint backup system status (total backups, size, directory).\n\n## Security\n\n- File hashes computed using SHA-256\n- Backup files stored with manifest for integrity verification\n- No external dependencies — pure Node.js crypto + zlib\n- Dry-run mode for safe preview before executing\n\n## Testing\n\n```bash\nnode tests/run-self-tests.js\n```\n\n### Test Coverage\n\n| Suite | Tests | Status |\n|---|---|---|\n| Self-tests (isolated) | 19 | ✅ Passing |\n\nFile v1.0.2:_meta.json\n\n{\n  \"ownerId\": \"kn7b6eyf5vc7khg5fr63pjm8xd82qvw5\",\n  \"slug\": \"backup-sync\",\n  \"version\": \"1.0.2\",\n  \"publishedAt\": 1784736261206\n}\n\nFile v1.0.2:skill-card.md\n\n## Description: <br>\nSmart Backup helps agents create, sync, verify, deduplicate, and restore local file backups with manifest tracking and zero external dependencies. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[jlacroix82](https://clawhub.ai/user/jlacroix82) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDevelopers and agent operators use Smart Backup to maintain local workspace backups, preview sync or restore operations, verify backup integrity, and find duplicate files. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Sync and restore operations can overwrite or delete local files. <br>\nMitigation: Run dry-run first, test on disposable destinations, and avoid restoring into directories with important existing files. <br>\nRisk: Backups may be stored under the skill or workspace backup directory rather than the destination argument shown in examples. <br>\nMitigation: Confirm the actual backup path with status or list commands before relying on a backup location. <br>\nRisk: Backup contents and manifests can expose sensitive files, full paths, file sizes, and directory structure. <br>\nMitigation: Store backups and manifests only in trusted locations and treat them as sensitive data. <br>\n\n\n## Reference(s): <br>\n- [Smart Backup on ClawHub](https://clawhub.ai/jlacroix82/skills/backup-sync) <br>\n- [README.md](README.md) <br>\n- [SKILL.md](SKILL.md) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [Shell commands, Files, Configuration, Guidance] <br>\n**Output Format:** [Markdown with inline bash code blocks; runtime operations create local backup files and JSON manifests.] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Local filesystem operations only; dry-run mode is available for previewing backup, sync, and restore actions.] <br>\n\n## Skill Version(s): <br>\n1.0.2 (source: server release evidence and clawhub.yaml) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nFile v1.0.2:clawhub.yaml\n\nslug: backup-sync\nname: backup-sync\ndescription: Intelligent file backup with compression, manifest tracking, verification, and deduplication. ⚠️ Destructive restore/sync. Always dry-run first.\nversion: 1.0.2\ntype: skill\nauthor: OpenClaw\nlicense: MIT\nkeywords:\n  - backup\n  - sync\n  - deduplication\n  - compression\n  - agent\nentry: SKILL.md\nowner: jlacroix82\ndependencies: []\n\nArchive v1.0.1: 8 files, 12399 bytes\n\nFiles: clawhub.yaml (323b), README.md (3272b), skill-card.md (2196b), SKILL.md (5126b), smart-backup.js (19439b), test/run-tests.js (1009b), tests/run-self-tests.js (8116b), _meta.json (130b)\n\nFile v1.0.1:SKILL.md\n\n---\nname: smart-backup\ndescription: Intelligent file backup with compression and verification. Backup, sync, verify integrity, dedup, and restore. Manifest tracking. Zero external dependencies.\n---\n\n# Smart Backup 💾\n\n**Stop losing config changes to disk failures. Start backing up intelligently.**\n\n## The Problem\n\nConfig 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.\n\nSmart Backup fixes this with automated backup, sync, verification, and deduplication.\n\n## Quick Start\n\n### Create a backup\n\n```bash\nnode skills/smart-backup/smart-backup.js --backup /home/jarvis/.openclaw /mnt/backup\n```\n\n### Preview backup without creating\n\n```bash\nnode skills/smart-backup/smart-backup.js --backup --dry-run /home/jarvis/.openclaw /mnt/backup\n```\n\n### Sync files between locations\n\n```bash\nnode skills/smart-backup/smart-backup.js --sync /home/jarvis/.openclaw /mnt/backup/sync\n```\n\nSyncs only changed files, deletes extras in destination.\n\n### Preview sync\n\n```bash\nnode skills/smart-backup/smart-backup.js --sync --dry-run /home/jarvis/.openclaw /mnt/backup/sync\n```\n\n### Verify backup integrity\n\n```bash\nnode skills/smart-backup/smart-backup.js --verify /path/to/backup-xxx\n```\n\nChecks SHA-256 hashes of all files against manifest.\n\n### Find duplicate files\n\n```bash\nnode skills/smart-backup/smart-backup.js --dedup /home/jarvis\n```\n\nGroups files by content hash, shows sizes and paths.\n\n### List available backups\n\n```bash\nnode skills/smart-backup/smart-backup.js --list\n```\n\n### Restore from backup\n\n```bash\nnode skills/smart-backup/smart-backup.js --restore /path/to/backup-xxx /restore/path\n```\n\n### Status overview\n\n```bash\nnode skills/smart-backup/smart-backup.js --status\n```\n\n### Incremental backup\n\n```bash\n# First backup (full)\nnode skills/smart-backup/smart-backup.js --backup /source /dest\n\n# Subsequent backups (only changed files)\nnode skills/smart-backup/smart-backup.js --backup /source /dest --incr\n```\n\nHash-based change detection — skips unchanged files for 10-100x speedup.\n\n## Features\n\n### Backup with Manifest\n\n- Creates timestamped backup directories\n- SHA-256 hash for every file in manifest\n- Total size and file count tracking\n- Skips `.git`, `node_modules`, `.cache`, `.npm` by default\n\n### Smart Sync\n\n- Copies new files, updates changed files, deletes extras\n- Hash-based change detection (not just timestamps)\n- Dry-run mode shows what would change before doing it\n\n### Integrity Verification\n\n- Verifies every file against stored SHA-256 hash\n- Reports missing files and hash mismatches\n- One-command verification of any backup\n\n### Incremental Backup\n\n- `--incr` flag enables hash-based change detection\n- Only backs up files that changed since last backup\n- Skips unchanged files (10-100x speedup)\n- Manifest tracks per-file SHA-256 hashes\n- `--from-manifest <id>` to base diff on specific manifest\n\n### Content-Aware Deduplication\n\n- Groups files by SHA-256 hash\n- Shows duplicate groups with sizes\n- Helps identify storage waste\n\n### Compression Ready\n\n- Manifest format supports compression (planned)\n- Estimated 60% compression savings shown in dry-run\n- Backup directory structure preserved\n\n## Configuration\n\nBackups stored in: `backups/smart-backups/`\n\nManifest stored in: `backups/smart-backups/manifest.json`\n\nOverride data directory:\n```bash\n--dir /path/to/data\n```\n\n## Agent Protocol\n\nDuring heartbeats and maintenance:\n\n1. **Weekly backup** — `--backup` your workspace to a safe location\n2. **Verify after backup** — `--verify` the latest backup\n3. **Dedup periodically** — `--dedup` to find and clean duplicates\n4. **List backups** — `--list` to check backup health\n5. **Dry-run first** — Always `--dry-run` before sync/backup on important dirs\n\n## Heartbeat Integration\n\nAdd to your `HEARTBEAT.md`:\n\n```markdown\n### 💾 Smart Backup\n\n- Weekly: `node skills/smart-backup/smart-backup.js --backup /home/jarvis/.openclaw /mnt/backup`\n- Verify: `node skills/smart-backup/smart-backup.js --verify <latest-backup>`\n- Dedup: `node skills/smart-backup/smart-backup.js --dedup /home/jarvis`\n```\n\n## Security Notes\n\n- File hashes are SHA-256 (integrity, not encryption)\n- Backups contain all file content — ensure backup storage is secure\n- Symlink-safe — uses standard fs operations\n- No network calls, all local\n\n## Comparison\n\n| Approach | Integrity Check | Dedup | Manifest | Automation |\n|----------|----------------|-------|----------|------------|\n| `cp -r` | ❌ | ❌ | ❌ | Manual |\n| `rsync` | ⚠️ | ❌ | ❌ | Auto |\n| **Smart Backup** | **✅** | **✅** | **✅** | **Auto** |\n\n**Smart Backup gives you integrity verification + dedup + manifest tracking in one tool.**\n\n## Design Principles\n\n1. **Zero setup** — Works immediately, no config needed\n2. **No dependencies** — Pure Node.js fs/crypto/zlib, no npm packages\n3. **Safe by default** — Skips known bloat directories, dry-run available\n4. **Transparent** — Every operation reports what it did\n5. **Persistent** — Manifests survive restarts and can verify integrity later\n\nFile v1.0.1:README.md\n\n# Smart Backup & Sync\n\nIntelligent file backup with gzip compression, incremental backups, verification, and deduplication.\n\n## Features\n\n- **Full Backups** — Create timestamped, compressed backups with manifest tracking\n- **Incremental Backups** — Only back up changed files since last manifest\n- **File Sync** — Sync files between directories with dry-run support\n- **Backup Verification** — Verify backup integrity (hash comparison)\n- **Restore** — Restore backups to a destination directory\n- **Deduplication** — Find duplicate files by content hash\n- **Status Overview** — View backup stats and storage health\n- **Compression** — Built-in gzip compression for backup files\n\n## Installation\n\n```bash\n# The skill is auto-loaded by OpenClaw via the skill registry.\n# For standalone use:\nconst SB = require('./smart-backup.js');\n```\n\n## Commands\n\n```\n--backup <source> <destination>           Create full backup\n--backup --dry-run <source> <dest>        Preview backup\n--sync <source> <destination>             Sync files between locations\n--sync --dry-run <source> <dest>          Preview sync\n--verify <backup_file>                    Verify backup integrity\n--dedup <dir>                             Content-aware deduplication\n--list                                     List available backups\n--restore <backup_file> <destination>     Restore from backup\n--status                                   Backup status overview\n```\n\n## API\n\n### `createBackup(source, destination, dryRun = false)`\nCreate a timestamped gzip-compressed backup of source directory.\n\n```javascript\nSB.createBackup('/home/user/projects', '/backups', false);\n```\n\n### `createIncrementalBackup(source, destination, fromManifest, dryRun)`\nOnly back up files that changed since the last manifest.\n\n```javascript\nSB.createIncrementalBackup('/home/user/projects', '/backups');\n```\n\n### `syncFiles(source, destination, dryRun)`\nSynchronize files from source to destination.\n\n```javascript\nSB.syncFiles('/home/user/projects', '/backups/mirror');\n```\n\n### `verifyBackup(backupFile)`\nVerify backup integrity by comparing file hashes.\n\n```javascript\nSB.verifyBackup('/backups/backup-2026-07-18-123456789');\n```\n\n### `listBackups()`\nList all available timestamped backups.\n\n### `restoreBackup(backupFile, destination)`\nRestore a backup to the specified destination.\n\n```javascript\nSB.restoreBackup('/backups/backup-2026-07-18-123456789', '/home/user/restored');\n```\n\n### `findDuplicates()`\nFind and report duplicate files by content hash.\n\n### `getFileHash(filepath)`\nGet SHA-256 hash of a file. Returns null for missing files.\n\n### `formatBytes(bytes)`\nFormat byte count as human-readable string (`1 KB`, `2.5 MB`).\n\n### `collectFiles(dir, skipDirs)`\nRecursively collect files in a directory, skipping common non-essential dirs.\n\n### `showStatus()`\nPrint backup system status (total backups, size, directory).\n\n## Security\n\n- File hashes computed using SHA-256\n- Backup files stored with manifest for integrity verification\n- No external dependencies — pure Node.js crypto + zlib\n- Dry-run mode for safe preview before executing\n\n## Testing\n\n```bash\nnode tests/run-self-tests.js\n```\n\n### Test Coverage\n\n| Suite | Tests | Status |\n|---|---|---|\n| Self-tests (isolated) | 19 | ✅ Passing |\n\nFile v1.0.1:_meta.json\n\n{\n  \"ownerId\": \"kn7b6eyf5vc7khg5fr63pjm8xd82qvw5\",\n  \"slug\": \"backup-sync\",\n  \"version\": \"1.0.1\",\n  \"publishedAt\": 1784512620403\n}\n\nFile v1.0.1:skill-card.md\n\n## Description: <br>\nIntelligent file backup with compression and verification, backup, sync, integrity verification, deduplication, restore, manifest tracking, and zero external dependencies. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[jlacroix82](https://clawhub.ai/user/jlacroix82) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDevelopers and agents use Smart Backup to create local backups, synchronize files, verify backup integrity, find duplicates, and restore files from recorded manifests. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Backups can include private projects, credentials, home directories, and other sensitive file contents. <br>\nMitigation: Run dry-run first, review the printed source and destination, avoid broad sensitive paths, and store backup output only in protected locations. <br>\nRisk: The security summary reports that copied file contents and path/hash metadata may be stored under an internal workspace backup area even when a different destination is supplied. <br>\nMitigation: Inspect the printed destination before proceeding, use an isolated workspace or controlled backup directory for sensitive data, and avoid using the skill on secrets until destination handling is fixed. <br>\n\n\n## Reference(s): <br>\n- [ClawHub skill page](https://clawhub.ai/jlacroix82/skills/backup-sync) <br>\n- [README](README.md) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [Shell commands, Files, JSON, Guidance] <br>\n**Output Format:** [Console text, filesystem copies, and JSON manifests] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Local file operations only; backup contents and path/hash metadata may be persisted under the skill workspace.] <br>\n\n## Skill Version(s): <br>\n1.0.1 (source: server release evidence and clawhub.yaml) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nFile v1.0.1:clawhub.yaml\n\nslug: backup-sync\nname: backup-sync\ndescription: Intelligent file backup with compression, manifest tracking, verification, and deduplication\nversion: 1.0.1\ntype: skill\nauthor: OpenClaw\nlicense: MIT\nkeywords:\n  - backup\n  - sync\n  - deduplication\n  - compression\n  - agent\nentry: SKILL.md\nowner: jlacroix82\ndependencies: []\n\nArchive v1.0.0: 8 files, 11991 bytes\n\nFiles: clawhub.yaml (323b), README.md (3272b), skill-card.md (2071b), SKILL.md (5126b), smart-backup.js (17902b), test/run-tests.js (1009b), tests/run-self-tests.js (8116b), _meta.json (130b)\n\nFile v1.0.0:SKILL.md\n\n---\nname: smart-backup\ndescription: Intelligent file backup with compression and verification. Backup, sync, verify integrity, dedup, and restore. Manifest tracking. Zero external dependencies.\n---\n\n# Smart Backup 💾\n\n**Stop losing config changes to disk failures. Start backing up intelligently.**\n\n## The Problem\n\nConfig 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.\n\nSmart Backup fixes this with automated backup, sync, verification, and deduplication.\n\n## Quick Start\n\n### Create a backup\n\n```bash\nnode skills/smart-backup/smart-backup.js --backup /home/jarvis/.openclaw /mnt/backup\n```\n\n### Preview backup without creating\n\n```bash\nnode skills/smart-backup/smart-backup.js --backup --dry-run /home/jarvis/.openclaw /mnt/backup\n```\n\n### Sync files between locations\n\n```bash\nnode skills/smart-backup/smart-backup.js --sync /home/jarvis/.openclaw /mnt/backup/sync\n```\n\nSyncs only changed files, deletes extras in destination.\n\n### Preview sync\n\n```bash\nnode skills/smart-backup/smart-backup.js --sync --dry-run /home/jarvis/.openclaw /mnt/backup/sync\n```\n\n### Verify backup integrity\n\n```bash\nnode skills/smart-backup/smart-backup.js --verify /path/to/backup-xxx\n```\n\nChecks SHA-256 hashes of all files against manifest.\n\n### Find duplicate files\n\n```bash\nnode skills/smart-backup/smart-backup.js --dedup /home/jarvis\n```\n\nGroups files by content hash, shows sizes and paths.\n\n### List available backups\n\n```bash\nnode skills/smart-backup/smart-backup.js --list\n```\n\n### Restore from backup\n\n```bash\nnode skills/smart-backup/smart-backup.js --restore /path/to/backup-xxx /restore/path\n```\n\n### Status overview\n\n```bash\nnode skills/smart-backup/smart-backup.js --status\n```\n\n### Incremental backup\n\n```bash\n# First backup (full)\nnode skills/smart-backup/smart-backup.js --backup /source /dest\n\n# Subsequent backups (only changed files)\nnode skills/smart-backup/smart-backup.js --backup /source /dest --incr\n```\n\nHash-based change detection — skips unchanged files for 10-100x speedup.\n\n## Features\n\n### Backup with Manifest\n\n- Creates timestamped backup directories\n- SHA-256 hash for every file in manifest\n- Total size and file count tracking\n- Skips `.git`, `node_modules`, `.cache`, `.npm` by default\n\n### Smart Sync\n\n- Copies new files, updates changed files, deletes extras\n- Hash-based change detection (not just timestamps)\n- Dry-run mode shows what would change before doing it\n\n### Integrity Verification\n\n- Verifies every file against stored SHA-256 hash\n- Reports missing files and hash mismatches\n- One-command verification of any backup\n\n### Incremental Backup\n\n- `--incr` flag enables hash-based change detection\n- Only backs up files that changed since last backup\n- Skips unchanged files (10-100x speedup)\n- Manifest tracks per-file SHA-256 hashes\n- `--from-manifest <id>` to base diff on specific manifest\n\n### Content-Aware Deduplication\n\n- Groups files by SHA-256 hash\n- Shows duplicate groups with sizes\n- Helps identify storage waste\n\n### Compression Ready\n\n- Manifest format supports compression (planned)\n- Estimated 60% compression savings shown in dry-run\n- Backup directory structure preserved\n\n## Configuration\n\nBackups stored in: `backups/smart-backups/`\n\nManifest stored in: `backups/smart-backups/manifest.json`\n\nOverride data directory:\n```bash\n--dir /path/to/data\n```\n\n## Agent Protocol\n\nDuring heartbeats and maintenance:\n\n1. **Weekly backup** — `--backup` your workspace to a safe location\n2. **Verify after backup** — `--verify` the latest backup\n3. **Dedup periodically** — `--dedup` to find and clean duplicates\n4. **List backups** — `--list` to check backup health\n5. **Dry-run first** — Always `--dry-run` before sync/backup on important dirs\n\n## Heartbeat Integration\n\nAdd to your `HEARTBEAT.md`:\n\n```markdown\n### 💾 Smart Backup\n\n- Weekly: `node skills/smart-backup/smart-backup.js --backup /home/jarvis/.openclaw /mnt/backup`\n- Verify: `node skills/smart-backup/smart-backup.js --verify <latest-backup>`\n- Dedup: `node skills/smart-backup/smart-backup.js --dedup /home/jarvis`\n```\n\n## Security Notes\n\n- File hashes are SHA-256 (integrity, not encryption)\n- Backups contain all file content — ensure backup storage is secure\n- Symlink-safe — uses standard fs operations\n- No network calls, all local\n\n## Comparison\n\n| Approach | Integrity Check | Dedup | Manifest | Automation |\n|----------|----------------|-------|----------|------------|\n| `cp -r` | ❌ | ❌ | ❌ | Manual |\n| `rsync` | ⚠️ | ❌ | ❌ | Auto |\n| **Smart Backup** | **✅** | **✅** | **✅** | **Auto** |\n\n**Smart Backup gives you integrity verification + dedup + manifest tracking in one tool.**\n\n## Design Principles\n\n1. **Zero setup** — Works immediately, no config needed\n2. **No dependencies** — Pure Node.js fs/crypto/zlib, no npm packages\n3. **Safe by default** — Skips known bloat directories, dry-run available\n4. **Transparent** — Every operation reports what it did\n5. **Persistent** — Manifests survive restarts and can verify integrity later\n\nFile v1.0.0:README.md\n\n# Smart Backup & Sync\n\nIntelligent file backup with gzip compression, incremental backups, verification, and deduplication.\n\n## Features\n\n- **Full Backups** — Create timestamped, compressed backups with manifest tracking\n- **Incremental Backups** — Only back up changed files since last manifest\n- **File Sync** — Sync files between directories with dry-run support\n- **Backup Verification** — Verify backup integrity (hash comparison)\n- **Restore** — Restore backups to a destination directory\n- **Deduplication** — Find duplicate files by content hash\n- **Status Overview** — View backup stats and storage health\n- **Compression** — Built-in gzip compression for backup files\n\n## Installation\n\n```bash\n# The skill is auto-loaded by OpenClaw via the skill registry.\n# For standalone use:\nconst SB = require('./smart-backup.js');\n```\n\n## Commands\n\n```\n--backup <source> <destination>           Create full backup\n--backup --dry-run <source> <dest>        Preview backup\n--sync <source> <destination>             Sync files between locations\n--sync --dry-run <source> <dest>          Preview sync\n--verify <backup_file>                    Verify backup integrity\n--dedup <dir>                             Content-aware deduplication\n--list                                     List available backups\n--restore <backup_file> <destination>     Restore from backup\n--status                                   Backup status overview\n```\n\n## API\n\n### `createBackup(source, destination, dryRun = false)`\nCreate a timestamped gzip-compressed backup of source directory.\n\n```javascript\nSB.createBackup('/home/user/projects', '/backups', false);\n```\n\n### `createIncrementalBackup(source, destination, fromManifest, dryRun)`\nOnly back up files that changed since the last manifest.\n\n```javascript\nSB.createIncrementalBackup('/home/user/projects', '/backups');\n```\n\n### `syncFiles(source, destination, dryRun)`\nSynchronize files from source to destination.\n\n```javascript\nSB.syncFiles('/home/user/projects', '/backups/mirror');\n```\n\n### `verifyBackup(backupFile)`\nVerify backup integrity by comparing file hashes.\n\n```javascript\nSB.verifyBackup('/backups/backup-2026-07-18-123456789');\n```\n\n### `listBackups()`\nList all available timestamped backups.\n\n### `restoreBackup(backupFile, destination)`\nRestore a backup to the specified destination.\n\n```javascript\nSB.restoreBackup('/backups/backup-2026-07-18-123456789', '/home/user/restored');\n```\n\n### `findDuplicates()`\nFind and report duplicate files by content hash.\n\n### `getFileHash(filepath)`\nGet SHA-256 hash of a file. Returns null for missing files.\n\n### `formatBytes(bytes)`\nFormat byte count as human-readable string (`1 KB`, `2.5 MB`).\n\n### `collectFiles(dir, skipDirs)`\nRecursively collect files in a directory, skipping common non-essential dirs.\n\n### `showStatus()`\nPrint backup system status (total backups, size, directory).\n\n## Security\n\n- File hashes computed using SHA-256\n- Backup files stored with manifest for integrity verification\n- No external dependencies — pure Node.js crypto + zlib\n- Dry-run mode for safe preview before executing\n\n## Testing\n\n```bash\nnode tests/run-self-tests.js\n```\n\n### Test Coverage\n\n| Suite | Tests | Status |\n|---|---|---|\n| Self-tests (isolated) | 19 | ✅ Passing |\n\nFile v1.0.0:_meta.json\n\n{\n  \"ownerId\": \"kn7b6eyf5vc7khg5fr63pjm8xd82qvw5\",\n  \"slug\": \"backup-sync\",\n  \"version\": \"1.0.0\",\n  \"publishedAt\": 1784410856764\n}\n\nFile v1.0.0:skill-card.md\n\n## Description: <br>\nIntelligent file backup with compression, manifest tracking, verification, deduplication, sync, and restore support. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[jlacroix82](https://clawhub.ai/user/jlacroix82) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDevelopers and agents use Smart Backup to create local backups, sync directories, verify backup integrity, find duplicate files, and restore files from backups. It is most useful for protecting workspaces, configuration directories, and other local project files before maintenance or recovery work. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Sync and restore operations can delete or overwrite local files. <br>\nMitigation: Use dry-run first, keep destination scopes narrow, and restore only into empty test directories until the result is verified. <br>\nRisk: Backups can contain secrets, private configuration, or other sensitive files. <br>\nMitigation: Store backups in access-controlled locations and avoid broad or shared destinations for sensitive directories. <br>\n\n\n## Reference(s): <br>\n- [ClawHub skill page](https://clawhub.ai/jlacroix82/skills/backup-sync) <br>\n- [Bundled README](artifact/README.md) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [Text, Markdown, Shell commands, Guidance] <br>\n**Output Format:** [Markdown instructions with shell command examples and local CLI text output] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Produces local filesystem backup, sync, verification, deduplication, and restore actions when the user runs the provided commands.] <br>\n\n## Skill Version(s): <br>\n1.0.0 (source: server release evidence) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nFile v1.0.0:clawhub.yaml\n\nslug: backup-sync\nname: backup-sync\ndescription: Intelligent file backup with compression, manifest tracking, verification, and deduplication\nversion: 1.0.0\ntype: skill\nauthor: OpenClaw\nlicense: MIT\nkeywords:\n  - backup\n  - sync\n  - deduplication\n  - compression\n  - agent\nentry: SKILL.md\nowner: jlacroix82\ndependencies: []","readmeExcerpt":"Skill: Smart Backup Owner: jlacroix82 Summary: Intelligent file backup with compression and verification. Backup, sync, verify integrity, dedup, and restore. Manifest tracking. Zero external dependencies. Tags: latest:1.0.8, security-fix:1.0.1 Version history: v1.0.8 | 2026-07-22T21:54:12.458Z | user v1.0.8: Safety fixes - restore preserves directory structure, --no-delete default for sync, --force for restore overwr","codeSnippets":[],"executableExamples":[{"language":"bash","snippet":"node skills/smart-backup/smart-backup.js --backup ~/openclaw /path/to/backup"},{"language":"bash","snippet":"node skills/smart-backup/smart-backup.js --backup --dry-run ~/openclaw /path/to/backup"},{"language":"bash","snippet":"node skills/smart-backup/smart-backup.js --sync ~/openclaw /path/to/backup/sync"},{"language":"bash","snippet":"node skills/smart-backup/smart-backup.js --sync --dry-run ~/openclaw /path/to/backup/sync"},{"language":"bash","snippet":"node skills/smart-backup/smart-backup.js --verify /path/to/backup-xxx"},{"language":"bash","snippet":"node skills/smart-backup/smart-backup.js --dedup ~/openclaw"}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\nname: smart-backup\ndescription: Intelligent file backup with compression and verification. Backup, sync, verify integrity, dedup, and restore. Manifest tracking. Zero external dependencies.\n---\n\n# Smart Backup 💾\n\n**Stop losing config changes to disk failures. Start backing up intelligently.**\n\n## The Problem\n\nConfig 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.\n\nSmart Backup fixes this with automated backup, sync, verification, and deduplication.\n\n## ⚠️ Important Warnings\n\n### Destructive Restore / Sync\n- `--restore` overwrites target files with backup contents\n- `--sync` two-way merges can create conflicts\n- Both operations are irreversible if run without `--dry-run` first\nAlways preview with `--dry-run` before executing.\n\n### Silent Data Duplication\nIf 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.\n\n### Manifest Privacy\nBackup manifests (`manifest.json`) contain full file paths and sizes, which may reveal directory structure and filenames. Treat manifests as sensitive metadata.\n\n### Incremental Metadata Persistence\nThe backup journal and deduplication hash database persist under the backup destination. These files (`incremental-index.json`, `dedup-hashes.json`) grow with each backup run.\n\n## Safety\n\nThis version includes safety fixes for the three ClawHub security audit findings:\n\n### `--no-delete` — Default for sync (safe)\nBy default, sync **does not delete** files in the destination that are absent from the source. This prevents accidental data loss.\n\n- `--no-delete` (default): files in dest not in source are skipped and logged with a WARNING\n- `--delete`: enables deletion. Without `--force`, lists files that would be deleted but does not delete them\n- `--delete --force`: actually deletes files absent from source, logging each one\n\n### `--force` — Required for restore overwrite\n`--restore` **skips existing files by default** instead of silently overwriting them.\n\n- Without `--force`: existing files are skipped; WARNING logged for each\n- With `--force`: existing files are overwritten; OVERWRITE logged for each\n\n### Restore preserves directory structure\nRestore 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>`.\n\n### Tests excluded from published bundle\nThe `test/` and `tests/` directories are development artifacts and are **not included** in the published skill bundle.\n\n## Quick Start\n\n### Create a backup\n\n```bash\nnode skills/smart-backup/smart-backup.js --backup ~/openclaw /path/to/backup\n```\n\n### Preview backup without creating\n\n```bash\nnode skills/smart-backup/smart-backup.js --backup --dry-run ~/openclaw /path/to/backup\n```\n\n#"},{"path":"README.md","content":"# Smart Backup & Sync\n\nIntelligent file backup with gzip compression, incremental backups, verification, and deduplication.\n\n## Features\n\n- **Full Backups** — Create timestamped, compressed backups with manifest tracking\n- **Incremental Backups** — Only back up changed files since last manifest\n- **File Sync** — Sync files between directories with dry-run support\n- **Backup Verification** — Verify backup integrity (hash comparison)\n- **Restore** — Restore backups to a destination directory\n- **Deduplication** — Find duplicate files by content hash\n- **Status Overview** — View backup stats and storage health\n- **Compression** — Built-in gzip compression for backup files\n\n## Installation\n\n```bash\n# The skill is auto-loaded by OpenClaw via the skill registry.\n# For standalone use:\nconst SB = require('./smart-backup.js');\n```\n\n## Commands\n\n```\n--backup <source> <destination>           Create full backup\n--backup --dry-run <source> <dest>        Preview backup\n--sync <source> <destination>             Sync files between locations\n--sync --dry-run <source> <dest>          Preview sync\n--verify <backup_file>                    Verify backup integrity\n--dedup <dir>                             Content-aware deduplication\n--list                                     List available backups\n--restore <backup_file> <destination>     Restore from backup\n--status                                   Backup status overview\n```\n\n## API\n\n### `createBackup(source, destination, dryRun = false)`\nCreate a timestamped gzip-compressed backup of source directory.\n\n```javascript\nSB.createBackup('/home/user/projects', '/backups', false);\n```\n\n### `createIncrementalBackup(source, destination, fromManifest, dryRun)`\nOnly back up files that changed since the last manifest.\n\n```javascript\nSB.createIncrementalBackup('/home/user/projects', '/backups');\n```\n\n### `syncFiles(source, destination, dryRun)`\nSynchronize files from source to destination.\n\n```javascript\nSB.syncFiles('/home/user/projects', '/backups/mirror');\n```\n\n### `verifyBackup(backupFile)`\nVerify backup integrity by comparing file hashes.\n\n```javascript\nSB.verifyBackup('/backups/backup-2026-07-18-123456789');\n```\n\n### `listBackups()`\nList all available timestamped backups.\n\n### `restoreBackup(backupFile, destination)`\nRestore a backup to the specified destination.\n\n```javascript\nSB.restoreBackup('/backups/backup-2026-07-18-123456789', '/home/user/restored');\n```\n\n### `findDuplicates()`\nFind and report duplicate files by content hash.\n\n### `getFileHash(filepath)`\nGet SHA-256 hash of a file. Returns null for missing files.\n\n### `formatBytes(bytes)`\nFormat byte count as human-readable string (`1 KB`, `2.5 MB`).\n\n### `collectFiles(dir, skipDirs)`\nRecursively collect files in a directory, skipping common non-essential dirs.\n\n### `showStatus()`\nPrint backup system status (total backups, size, directory).\n\n## Security\n\n- File hashes computed using SHA-256\n- Backup files stored with manifest for integrity verification\n- No extern"},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn7b6eyf5vc7khg5fr63pjm8xd82qvw5\",\n  \"slug\": \"backup-sync\",\n  \"version\": \"1.0.8\",\n  \"publishedAt\": 1784757252458\n}"},{"path":"skill-card.md","content":"## Description:\n\nIntelligent file backup with compression and verification. Backup, sync, verify integrity, dedup, and restore. Manifest tracking. Zero external dependencies.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[jlacroix82](https://clawhub.ai/user/jlacroix82)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers and agents use Smart Backup to create local backups, sync directory copies, verify backup manifests, restore files, and identify duplicate content during workspace maintenance.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Local backup, sync, and restore operations may read, write, overwrite, delete, or restore files outside the locations a user intended.\n\nMitigation: Review paths before execution, run on non-sensitive test directories first, use dry-run previews, and avoid --force or --delete unless the affected paths have been inspected.\n\nRisk: Backups and manifests may expose sensitive file contents, full paths, sizes, and directory structure.\n\nMitigation: Store backups and manifests only in trusted locations with appropriate access controls, and avoid using the skill on sensitive directories until the release has been reviewed.\n\nRisk: Advertised compression, destination selection, symlink safety, and full SHA-256 integrity behavior may not match the implementation.\n\nMitigation: Do not rely on those claims for critical recovery workflows until implementation fixes are reviewed and verified.\n\n## Reference(s):\n\n- [ClawHub Skill Page](https://clawhub.ai/jlacroix82/skills/backup-sync)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, shell commands, configuration, guidance]\n\n**Output Format:** [Markdown with inline shell commands and configuration snippets]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Produces local backup, sync, verification, restore, deduplication, and status guidance for agent workflows.]\n\n## Skill Version(s):\n\n1.0.8 (source: server release evidence)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment."},{"path":"clawhub.yaml","content":"slug: backup-sync\nname: backup-sync\ndescription: Intelligent file backup with compression, manifest tracking, verification, and deduplication. ⚠️ Destructive restore/sync. Always dry-run first.\nversion: 1.0.5\ntype: skill\nauthor: OpenClaw\nlicense: MIT\nkeywords:\n  - backup\n  - sync\n  - deduplication\n  - compression\n  - agent\nentry: SKILL.md\nowner: jlacroix82\ndependencies: []"}],"languages":[],"docsSourceLabel":"CLAWHUB","editorialOverview":"Intelligent file backup with compression and verification. Backup, sync, verify integrity, dedup, and restore. Manifest tracking. Zero external dependencies. Skill: Smart Backup Owner: jlacroix82 Summary: Intelligent file backup with compression and verification. Backup, sync, verify integrity, dedup, and restore. Manifest tracking. Zero external dependencies. Tags: latest:1.0.8, security-fix:1.0.1 Version history: v1.0.8 | 2026-07-22T21:54:12.458Z | user v1.0.8: Safety fixes - restore preserves directory structure, --no-delete default for sync, --force for restore overwr","editorialQuality":{"score":100,"threshold":65,"status":"ready","wordCount":1464,"uniquenessScore":46,"reasons":[]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-11T21:31:26.896Z","emptyReason":"No screenshots, media assets, or demo links are available."},"primaryImageUrl":null,"mediaAssetCount":0,"assets":[],"demoUrl":null},"ownerResources":{"evidence":{"source":"unclaimed","verified":false,"confidence":"low","updatedAt":"2026-10-11T21:31:26.896Z","emptyReason":"This page has not been claimed by the agent owner."},"hasCustomPage":false,"customPageUpdatedAt":null,"customLinks":[],"structuredLinks":{"docsUrl":null,"demoUrl":null,"supportUrl":null,"pricingUrl":null,"statusUrl":null},"customPage":null},"relatedAgents":{"evidence":{"source":"protocol-neighbors","verified":false,"confidence":"medium","updatedAt":"2026-10-12T20:16:08.761Z","emptyReason":null},"items":[{"id":"8ebccd8e-3863-4187-8355-c3f14e1f9edf","entityType":"agent","canonicalPath":"/agent/iofficeai-aionui","slug":"iofficeai-aionui","name":"AionUi","description":"Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!","url":"https://github.com/iOfficeAI/AionUi","homepage":"https://www.aionui.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-10-09T19:11:12.944Z","createdAt":"2026-02-25T03:38:16.584Z","downloads":null},{"id":"b917f68a-ebff-438e-84f8-3f4b2494c0bc","entityType":"agent","canonicalPath":"/agent/activepieces-activepieces","slug":"activepieces-activepieces","name":"activepieces","description":"AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents","url":"https://github.com/activepieces/activepieces","homepage":"https://www.activepieces.com","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-15T02:22:12.426Z","createdAt":"2026-02-25T03:38:12.412Z","downloads":null},{"id":"5cb26759-3a39-483f-94cf-276a98c13bb8","entityType":"agent","canonicalPath":"/agent/cherryhq-cherry-studio","slug":"cherryhq-cherry-studio","name":"cherry-studio","description":"AI productivity studio with smart chat, autonomous agents, and 300+ assistants. Unified access to frontier LLMs","url":"https://github.com/CherryHQ/cherry-studio","homepage":"https://cherry-ai.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-11T14:38:40.986Z","createdAt":"2026-02-25T03:38:19.379Z","downloads":null},{"id":"6f6582d0-5d76-4f0f-b81d-86520247950b","entityType":"agent","canonicalPath":"/agent/copilotkit-copilotkit","slug":"copilotkit-copilotkit","name":"CopilotKit","description":"The Frontend for Agents & Generative UI. React + Angular","url":"https://github.com/CopilotKit/CopilotKit","homepage":"https://docs.copilotkit.ai","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-03-25T09:50:57.846Z","createdAt":"2026-02-25T03:39:14.617Z","downloads":null}],"links":{"hub":"/agent","source":"/agent/source/clawhub","protocols":[{"label":"OpenClaw","href":"/agent/protocol/openclew"}]}}}