# UNIFIED BACKUP — RESUME / STATUS (updated 2026-08-20) ## STATE - Tooling BUILT + VALIDATED + COMMITTED (local, not pushed). launchd agent INSTALLED but PAUSED. - AWAITING operator GATE: real `unified-backup.zsh --apply` run on the Studio. - Nothing has moved. Agent unloaded (safe). Dry-runs confirmed 0 changes. ## WHAT EXISTS - bin/unified-backup.zsh (machine MOVE phase + 2TB COPY phase, dedup via _ledger) - config/backup3/{backup3.conf, machines/mac-studio.conf, machines/ole-blu.conf} - launchd/com.psingletary.backup3.plist -> points at unified-backup.zsh --apply - docs/UNIFIED-BACKUP-MAPPING.md (full design) - Committed as 6fa40d5 in ~/dev/_shared (NOT pushed — remote force-diverged, ahead 31/behind 56) ## KEY DECISIONS (locked 2026-08-20) - Machine (Studio+Air): MOVE (free local disk). 2TB: COPY. X10 canonical tree is authoritative. - No per-machine subdirs; provenance in _ledger (provenance.csv = reorg index, + provenance-machines.csv) - USE_ONEDRIVE=no (launchd OneDrive mkdir deadlocks "Resource deadlock avoided" — known File Provider issue). All files -> X10 canonical. Re-enable USE_ONEDRIVE=yes for manual runs only. - stacher (adult) -> z-New folder/stacher/. streamlink/unique -> Downloads/. - 2TB uses rsync --ignore-existing (fast, no full re-hash on every launchd fire). ## VALIDATED DRY-RUN (Studio, X10 mounted, 2TB mounted) - Machine phase: 1,127 WOULD-MOVE + 54 DEDUP-MOVE, 0 mystery lines, 0 OneDrive refs. - 2TB phase: Media->Media, Archive->Archive, QBT->QBT/torrents, Pictures->Pictures, Media/Movies->Media/Movies, Media/TV->Media/TV, photos-restore bundle -> photos-restore.photoslibrary. - EXIT=0 in all dry-runs. Source dirs untouched (Downloads 911/133G, Movies 268, etc.) ## BUGS FIXED DURING BUILD - zsh 5.9: `local var` declared per-iteration inside a loop echoed assignments to stdout. Fix: hoist all `local` declarations to function top. - du -sk on TCC-protected Photos Library.photoslibrary returns rc=1 (op not permitted) -> broke set -e. Fix: `du ... | cut -f1 || true`. - Machine hostname is mac.lan (not mac-studio); fixed detection to use scutil LocalHostName. ## NEXT STEP (operator GATE required) 1. Review /tmp/machine-nood.log (full machine dry-run) + /tmp/full-dryrun.log (with 2TB). 2. Approve real run: cd ~/dev/_shared && ./bin/unified-backup.zsh --apply # machine MOVE + 2TB COPY (or --apply --no-2tb for machine phase only). 3. After it completes: verify provenance-machines.csv, confirm Studio freed ~135 GB, X10 Media grew. 4. Then load the launchd agent for ongoing automation: launchctl load ~/Library/LaunchAgents/com.psingletary.backup3.plist 5. Same script backs up the Air when X10 is attached to it (ole-blu.conf already wired). 6. Push _shared only after resolving the remote divergence (ahead 31 / behind 56). Do NOT force-push blindly.