No description
  • Swift 94.9%
  • Ruby 5.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Martin Faust b0da8a9ae8 Add pruning: long-term trash with lastSeen grace window
The backup keeps assets deleted from the Photos library as a safety net, then
sweeps them once gone past a grace window.

- Schema v2 adds asset.lastSeenInLibrary, stamped every scan for present assets
  (indexedAt now means first-seen). Resources + album membership cascade-delete.
- PruneManager.plan() refreshes presence first (allAssetIDs → touchLastSeen), so
  a long scan gap can't sweep still-present photos; selects lastSeenInLibrary <
  cutoff (now − grace, or now for "sweep all gone"). execute() deletes files then
  rows.
- AppModel two-phase prune (preparePrune → confirm dialog → confirmPrune),
  persisted pruneGraceDays (default 90). BackupView Step 3 with grace stepper,
  "Prune gone > Nd", "Sweep All Gone Now", and a destructive confirmation.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-23 11:29:21 +02:00
iCloudPhotoBackup Add pruning: long-term trash with lastSeen grace window 2026-07-23 11:29:21 +02:00
iCloudPhotoBackup.xcodeproj Add pruning: long-term trash with lastSeen grace window 2026-07-23 11:29:21 +02:00
scripts Add app + .photobackup document icon 2026-07-20 20:55:44 +02:00
.gitignore Add iCloudPhotoBackup: on-demand Photos-library backup app 2026-07-20 18:05:52 +02:00
CLAUDE.md Add pruning: long-term trash with lastSeen grace window 2026-07-23 11:29:21 +02:00
README.md Add iCloudPhotoBackup: on-demand Photos-library backup app 2026-07-20 18:05:52 +02:00

iCloud Photo Backup

A native macOS app that downloads originals out of your Apple Photos library into a portable .photobackup bundle — built for libraries too large to keep on local disk.

With Optimize Mac Storage, your Mac only holds thumbnails and the originals live in iCloud. This app:

  1. Indexes your whole library's metadata (fast, offline) into a SQLite manifest — including album membership, favorites, dates, and location.
  2. Downloads the originals you ask for — by date range or the whole library — pulling them from iCloud on demand and writing every resource (RAW + JPEG, Live Photo video, edits) to disk.

The backup is append-only: scanning and downloading only add. Removing things from a backup ("pruning") is a separate, deliberate step (roadmap).

Build

gem install --user-install xcodeproj      # only if regenerating the project
ruby scripts/generate_project.rb          # regenerate iCloudPhotoBackup.xcodeproj

xcodebuild -project iCloudPhotoBackup.xcodeproj -scheme iCloudPhotoBackup \
  -configuration Debug -destination 'platform=macOS' build

Requires macOS 26.2 / Xcode 26.2. Depends on GRDB.swift (SQLite), resolved automatically via Swift Package Manager.

See CLAUDE.md for architecture and conventions.