π¦ ClawHub
Sync
by @ivangdavila
Synchronize files and directories between local, remote, and cloud storage reliably.
TERMINAL
clawhub install syncπ About This Skill
name: Sync description: Synchronize files and directories between local, remote, and cloud storage reliably. metadata: {"clawdbot":{"emoji":"π","requires":{"anyBins":["rsync","rclone"]},"os":["linux","darwin","win32"]}}
File Synchronization Rules
rsync Fundamentals
rsync src/ copies contents, rsync src copies the folder itself β this is the #1 cause of wrong directory structures-avz baseline: archive mode preserves permissions/timestamps, verbose shows progress, compress speeds transfers--delete only when you want destination to mirror source exactly β without it, deleted source files remain on destination--dry-run before any destructive sync β shows what would change without modifying anythingExclusions
--exclude flags: rsync -avz --exclude-from=.syncignore src/ dest/.git/, node_modules/, __pycache__/, .venv/, *.pyc, .DS_Store, Thumbs.db/logs/ excludes only top-level logs, logs/ excludes logs/ anywhereCloud Storage (rclone)
rclone sync deletes destination files not in source; rclone copy only adds β use copy when unsurerclone config β never hardcode cloud credentials in scripts--dry-run first, then --progress for visual feedback during actual sync--s3-chunk-size 64M for large files to avoid timeoutsVerification
rsync -avzc uses checksums instead of size/time (slower but certain)rclone check source: dest: to compare without transferringrsync -avz src/ dest/ | tee sync.logBidirectional Sync
unison dir1 dir2Remote Sync
rsync -avz -e "ssh -i ~/.ssh/key" src/ user@host:dest/-e "ssh -p 2222"--partial --progress for large files over unreliable connections β allows resume on failureCommon Pitfalls
--delete repeatedly causes destination to accumulate deleted files forever--checksum for accuracy or sync NTP first