Files
System-Sync-Restore/config/ssr.conf.example
T
Oliver Surke 698cbe145a feat: async iCloud prefetch + keep-local for Mackup folder
lib/icloud.sh (new):
  ssr::icloud::prefetch <dir>    — spawn background open -g requests for
    all .icloud stubs; returns immediately so other work can run in parallel.
  ssr::icloud::wait <dir> [sec]  — poll until stubs are gone or timeout
    (default 180s). Logs progress every 5s.
  ssr::icloud::keep_local <dir>  — after sync, removes
    com.apple.icloud.evictable xattr from every real file + updates
    access-time (LRU delay), preventing iCloud from re-creating stubs
    before the next run. Best-effort (no public pin API on macOS CLI).

bin/ssr-sync:
  - prefetch Mackup folder immediately after cloud is available (before
    brew update/upgrade) so downloads proceed in the background.
  - ssr::icloud::wait called just before mackup backup.
  - ssr::icloud::keep_local called after sync completes.
  - SSR_ICLOUD_WAIT_TIMEOUT (default 180) and SSR_ICLOUD_KEEP_LOCAL
    (default true) config toggles added.

bin/ssr-restore:
  - prefetch Mackup folder right after cloud is validated, before the
    brew bundle install step, maximising download time available.

config/ssr.conf.example:
  Added SSR_ICLOUD_WAIT_TIMEOUT and SSR_ICLOUD_KEEP_LOCAL keys.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-12 09:46:12 +02:00

93 lines
4.1 KiB
Plaintext

# ssr.conf — System Sync & Restore configuration.
# Format: simple KEY=VALUE pairs. Comments (# …) and blank lines allowed.
# This file is sourced by bash; only the keys below are recognized.
# Anything else will cause ssr to abort.
# ---------------------------------------------------------------------------
# Cloud storage
# ---------------------------------------------------------------------------
# Provider: icloud | dropbox | googledrive | onedrive | custom
SSR_CLOUD_PROVIDER=icloud
# Only used when SSR_CLOUD_PROVIDER=custom. Absolute path.
# SSR_CLOUD_PATH=/Volumes/MyNAS/macos-sync
# Subfolders created inside the cloud root.
SSR_BACKUP_SUBDIR=BACKUP
SSR_MACKUP_SUBDIR=Mackup
# ---------------------------------------------------------------------------
# Homebrew behavior during `ssr sync`
# ---------------------------------------------------------------------------
SSR_BREW_UPGRADE=true
SSR_BREW_CLEANUP=true
# ---------------------------------------------------------------------------
# Unmanaged-app scan during sync
# ---------------------------------------------------------------------------
# ---------------------------------------------------------------------------
# iCloud prefetch & keep-local
# ---------------------------------------------------------------------------
# Trigger async iCloud download at sync/restore start so files are available
# before Mackup runs. Wait up to this many seconds before proceeding.
# SSR_ICLOUD_WAIT_TIMEOUT=180
# After sync, mark Mackup folder files as keep-local to prevent iCloud from
# re-evicting them before the next run (LRU touch + xattr, best-effort).
SSR_ICLOUD_KEEP_LOCAL=true
# ---------------------------------------------------------------------------
# Lists .app bundles installed manually (not via brew cask, not via MAS).
# Writes <backup_dir>/unmanaged-apps.txt for restore-time reference.
SSR_SCAN_UNMANAGED_APPS=true
# Colon-separated directories to scan (top level only).
# SSR_APP_DIRS=/Applications:$HOME/Applications
# ---------------------------------------------------------------------------
# macOS preferences snapshot (sync + restore)
# ---------------------------------------------------------------------------
# Snapshot configured pref domains to <backup_dir>/macos-prefs/ during sync
# and replay them at the end of restore (after macos-defaults.sh).
SSR_SNAPSHOT_MACOS_PREFS=true
# Full override of the domain list (space-separated). Uncomment to replace
# the built-in default set.
# SSR_MACOS_PREF_DOMAINS="com.apple.dock com.apple.finder com.apple.symbolichotkeys com.apple.HIToolbox com.apple.spaces com.apple.menuextra.clock NSGlobalDomain"
# Append extra domains to the default set without replacing it.
# SSR_MACOS_PREF_DOMAINS_EXTRA="com.apple.universalaccess com.apple.Spotlight"
# How to resolve conflicts when restore is non-interactive (no TTY, launchd).
# "accept" = snapshot wins; "reject" = declarative macos-defaults.sh wins.
SSR_PREFS_CONFLICT_DEFAULT=accept
# Set to "true" to skip all conflict prompts and auto-accept everywhere.
# SSR_ASSUME_YES=false
# ---------------------------------------------------------------------------
# macOS restore behavior
# ---------------------------------------------------------------------------
# Disabling Gatekeeper allows apps from anywhere. Off by default.
SSR_DISABLE_GATEKEEPER=false
# Open every installed cask once after restore (for first-run config).
SSR_OPEN_CASKS=false
# Path to the macOS defaults script applied at the end of `ssr restore`.
# Leave commented to use the repo default (config/macos-defaults.sh).
# SSR_MACOS_DEFAULTS=/path/to/your/macos-defaults.sh
# ---------------------------------------------------------------------------
# Scheduling
# ---------------------------------------------------------------------------
SSR_LAUNCHD_LABEL=de.surke.ssr.sync
SSR_SCHEDULE_HOUR=9
SSR_SCHEDULE_MINUTE=0
# ---------------------------------------------------------------------------
# Paths
# ---------------------------------------------------------------------------
# SSR_STATE_DIR=$HOME/.local/state/ssr
# SSR_LOG_DIR=$HOME/.local/state/ssr/logs