Mac OS - Recovery#


1. Pre-Crash Backup Checklist (Do This Now)#

Ensure these configurations are regularly backed up or pushed to GitHub to prevent data loss.

  • 1.1 Setup Brewfile Versioning: Dump, commit, and push your system package lists.
  • 1.2 Sync Packages & Scripts: Track changes to package lists using pushbrew and script/alias updates using pushscripts.
    • Details: Completed. Use pushbrew for package list updates and pushscripts for codebase updates. See Mac OS - Brewfile.
  • 1.3 Automate MCP Config Pushes: Update the mcp alias to push local configuration commits.
    • Details: Completed. mcp alias now auto-commits and pushes local changes to GitHub (MCP-Config-MacOS).
  • 1.4 Version-Control Custom Aliases: Migrate custom shortcuts out of local configurations.
  • 1.5 Double Check Git Hook Backups: Save a copy of your Git hooks.
    • Details: Completed. The mirror hook is backed up at ~/Scripts/MacOS/post-commit-hook.sh.

2. Workstation Rebuild Checklist (In Case of Crash)#

Follow these steps in order to restore the Mac Studio environment on a fresh macOS installation.

  • 2.1 Install Homebrew
    • Run the official installation script:
      /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  • 2.2 Clone the Scripts Repository
    • Pull down all custom automation, environment setups, and sync scripts:
      git clone git@github.com:marcoue/Scripts.git ~/Scripts
  • 2.3 Restore Shell Profile and Aliases
    • Run the auto-restore script to recreate your local profile structure:
      source ~/Scripts/MacOS/Aliases/MacOS_Aliases_restore.sh
    • Retrieve the 1Password Token and OpenAI API Key from your 1Password Homelab Vault under the entry Mac OS .zshrc file and write them into the placeholders in ~/.zshrc.
    • See Mac OS - Aliases Management for detailed manual secrets configurations.
  • 2.4 Restore Software Stack via Brewfile
    • Reinstall all CLI tools, Casks, and VS Code extensions:
      brew bundle --file=~/Scripts/MacOS/Brew/Brewfile
    • See Mac OS - Brewfile for downstream syncing instructions.
  • 2.5 Mount NAS Network Shares
    • Connect to the central UNAS-Pro share:
      mkdir -p /Volumes/Software
      mount -t smbfs //10.1.2.2/Software /Volumes/Software
    • Re-create local shortcut symlinks:
      mkdir -p ~/SMBShares
      ln -s /Volumes/Software ~/SMBShares/Software
  • 2.6 Restore Obsidian Vault
    • Clone the Obsidian Homelab vault:
      git clone git@github.com:marcoue/obsidian-homelab.git ~/Obsidian/Homelab
  • 2.7 Redeploy Git Post-Commit Hooks
    • Set up the automatic mirror hook to sync local scripts to the NAS:
      cp ~/Scripts/MacOS/post-commit-hook.sh ~/Scripts/.git/hooks/post-commit
      chmod +x ~/Scripts/.git/hooks/post-commit
  • 2.8 Restore MCP Server Configurations
    • Clone the MCP configuration repo:
      git clone git@github.com:marcoue/MCP-Config-MacOS.git ~/.mcp-config
    • Run the configuration applicator:
      python3 ~/.mcp-config/apply.py
  • 2.9 Enable System-Level Services (Cron & Terminal FDA)
    • Go to System Settings > Privacy & Security > Full Disk Access and add /usr/sbin/cron and Terminal.
    • Under Files and Folders, ensure cron has access to Network Volumes.
    • Configure the crontab:
      crontab -e
      Add the active sync routines:
      # Homelab Sync: Daily at 12:10 PM and 8:10 PM
      10 12 * * * bash /Users/marc/Scripts/MacOS/sync-obsidian-homelab-hugo.sh >> /Users/marc/Scripts/MacOS/sync-obsidian-homelab-hugo.log 2>&1
      10 20 * * * bash /Users/marc/Scripts/MacOS/sync-obsidian-homelab-hugo.sh >> /Users/marc/Scripts/MacOS/sync-obsidian-homelab-hugo.log 2>&1
      
      # GenDash Sync: Daily at 12:10 PM and 8:10 PM
      10 12 * * * bash /Users/marc/Scripts/MacOS/sync-obsidian-gendash-hugo.sh >> /Users/marc/Scripts/MacOS/sync-obsidian-gendash-hugo.log 2>&1
      10 20 * * * bash /Users/marc/Scripts/MacOS/sync-obsidian-gendash-hugo.sh >> /Users/marc/Scripts/MacOS/sync-obsidian-gendash-hugo.log 2>&1