Scripts Management Migration Plan#

This document is the master architectural migration plan for establishing /Users/marc/Scripts as your primary local master Git repository, linked to git@github.com:marcoue/Scripts.git, with automated mirroring to the UNAS-Pro NAS (/Volumes/Software/Software/Scripts/) and automated pull execution by remote TrueNAS/Linux/Proxmox nodes.


1. Executive Summary & Architecture Goal#

🎯 Primary Master Architecture#

  1. Master Repository: /Users/marc/Scripts on your Mac SSD is your primary master repository for editing, testing, running, and managing all homelab scripts.
  2. GitHub Remote: Linked to git@github.com:marcoue/Scripts.git on branch main.
  3. Automated NAS Mirroring: A Git post-commit hook automatically syncs committed scripts from ~/Scripts/ to /Volumes/Software/Software/Scripts/ on UNAS-Pro.
  4. Remote Server Pull Execution: Remote servers (HP1, HP2, HP3, HP7, HP8, Proxmox, Linux) pull their scripts from UNAS-Pro (Software/Scripts/) on their scheduled runs.

🔄 Data & Deployment Flow#

  [Mac Workstation] (Primary Master Workspace)
   └── ~/Scripts/ (git@github.com:marcoue/Scripts.git)
        ├── MacOS/
        ├── Linux/
        ├── Proxmox/
        └── TrueNAS/
             │
             ├── (git commit)
             â–¼
        [Git post-commit Hook]
             │
             ├── (rsync auto-mirror)
             â–¼
  [UNAS-Pro Master NAS] (Distribution Mirror)
   └── /Volumes/Software/Software/Scripts/
        ├── MacOS/
        ├── Linux/
        ├── Proxmox/
        └── TrueNAS/ (Exposed as Rsync Module: root@10.1.2.2::Software/Scripts/TrueNAS/)
             │
             ├── (Rsync pull on schedule)
             â–¼
  [Remote Nodes: HP1, HP2, HP3, HP7, HP8, Proxmox, Linux]
   └── Local Execution of Version-Controlled Scripts

📂 1.1 Filesystem Standard & Disaster Recovery Protocol#

  1. Standard POSIX Filesystem Path:
    • The destination path /Volumes/Software/Software/Scripts/ (and subfolders MacOS/, Linux/, Proxmox/, TrueNAS/) is a standard, plain-text directory tree residing on the mounted Software SMB share (smb://10.1.2.2/Software). There are zero proprietary databases, hidden hooks, or custom file structures on the NAS.
  2. Mac Auto-Mount Convenience (Login Items):
    • To ensure the SMB share is always available for Git post-commit auto-mirroring, add /Volumes/Software to macOS System Settings > General > Login Items.
  3. macOS Reinstall / Disaster Recovery:
    • Reinstalling or replacing macOS on your Mac Studio has zero effect on UNAS-Pro or TrueNAS servers. The NAS files remain intact, and TrueNAS backup cron jobs continue executing without interruption.
    • To restore your Mac workstation repo after a fresh macOS install:
      # Step 1: Clone master repository from GitHub
      git clone git@github.com:marcoue/Scripts.git ~/Scripts
      
      # Step 2: Re-install 1-line Git post-commit auto-mirror hook
      cat << 'EOF' > ~/Scripts/.git/hooks/post-commit
      #!/usr/bin/env bash
      if [ -d "/Volumes/Software/Software/Scripts" ]; then
          rsync -av --delete --exclude='.git' --exclude='*.log' /Users/marc/Scripts/ /Volumes/Software/Software/Scripts/
      fi
      EOF
      chmod +x ~/Scripts/.git/hooks/post-commit

2. Complete Script Inventory & Mapping#

The following table lists all existing scripts found across your NAS repository (git@github.com:marcoue/Scripts.git) and local Mac folder (~/Scripts/), mapped to their final category subfolders:

Script Name Current Location Final Repository Subfolder Description / Purpose
speed.sh NAS (Scripts/Linux/) Linux/ Network speed test utility
speed_2.sh NAS (Scripts/Linux/) Linux/ Alternative network speed test utility
setup_ai_safety.sh NAS (Scripts/Linux/) Linux/ AI environment safety setup script
publish-hugo-homelab.sh NAS (Scripts/Linux/) Linux/ Hugo Homelab publication script
publish-hugo-gendash.sh NAS (Scripts/Linux/) Linux/ Hugo GenDash publication script
RN-VPSPangoling_pull_backups.sh Local (~/Scripts/Linux/) Linux/ Pangolin VPS pull backup script (LXC 102)
RN-VPSPangoling_pull_backups_integrity_check.sh Local (~/Scripts/Linux/) Linux/ Pangolin VPS backup integrity validation script (LXC 102)
proxmox_backup.sh NAS (Scripts/Proxmox/) Proxmox/ Automated Proxmox node/VM backup script
proxmox_restore.sh NAS (Scripts/Proxmox/) Proxmox/ Automated Proxmox node/VM restore script
pbs_backup_universal.sh.back NAS (Scripts/Proxmox/Archives/) Proxmox/Archives/ Archived PBS backup script
pve_backup_universal.sh.back NAS (Scripts/Proxmox/Archives/) Proxmox/Archives/ Archived PVE backup script
KVM-Launch.sh Both (~/Scripts/ & NAS) MacOS/ Tripp Lite KVM Java Virtual Console launcher for macOS
[Rclone](RClone.md)-MarcGoogleDrive.sh NAS (Scripts/MacOS/) MacOS/ Rclone sync script for Marc’s Google Drive
file_indexer.sh NAS (Scripts/MacOS/) MacOS/ macOS file indexing script
convert_images_900.sh Local (~/Scripts/) MacOS/ Image conversion & resizing script
lock_gendash.sh Local (~/Scripts/) MacOS/ GenDash desktop security locking script
sync-obsidian-homelab-hugo.sh Local (~/Scripts/) MacOS/ Syncs Obsidian Homelab notes to Hugo static site
sync-obsidian-gendash-hugo.sh Local (~/Scripts/) MacOS/ Syncs Obsidian GenDash notes to Hugo static site
sync-obsidian-peru-hugo.sh Local (~/Scripts/) MacOS/ Syncs Obsidian Peru notes to Hugo static site
HP1_UNAS_Pull_Backup.sh (New) TrueNAS/ Standalone Rsync pull script for HP1
HP2_UNAS_Pull_Backup.sh (New) TrueNAS/ Standalone Rsync pull script for HP2
HP3_UNAS_Pull_Backup.sh (New) TrueNAS/ Standalone Rsync pull script for HP3
HP7_UNAS_Pull_Backup.sh (New) TrueNAS/ Standalone Rsync pull script for HP7
HP8_UNAS_Pull_Backup.sh (New) TrueNAS/ Standalone Rsync pull script for HP8

3. Phase 1: Establish /Users/marc/Scripts as Master Git Repository#

  • 1.1 Interactive Diff Audit & Verification (Local Mac vs. NAS Repository)

    • Audit Executed on 2026-07-27: SHA256 checksums and byte-by-byte comparisons (cmp) verified 100% identity across all 6 local Mac scripts against the NAS repository. Zero code divergence detected.
  • 1.2 Local Path Dependency Audit (Zero-Breakage Check)

    • Audit Executed on 2026-07-27:
      • 1.2.1 Shell Profiles Audit: Scanned ~/.zshrc (7 aliases found).
      • 1.2.2 LaunchAgents Audit: Scanned ~/Library/LaunchAgents/ (0 daemons found).
      • 1.2.3 Local Crontab Audit: Scanned crontab -l (5 scheduled jobs found).
      • 1.2.4 Obsidian & Hugo Audit: Scanned Obsidian vault (5 documentation notes found).
  • 1.3 Initialize Git In-Place in /Users/marc/Scripts

    • Initialized empty Git repository in /Users/marc/Scripts/.git/, linked to git@github.com:marcoue/Scripts.git, and set to track origin/main.
  • 1.4 Organize Mac Scripts into ~/Scripts/MacOS/

    • Created category subdirectories (MacOS/, Linux/, Proxmox/, TrueNAS/) and moved all local Mac scripts cleanly into /Users/marc/Scripts/MacOS/. Granted chmod +x.
  • 1.5 Update System Callers & Documentation Directly (No Symlinks)

    • 1.5.1 Update ~/.zshrc Terminal Aliases: Updated push, pushgen, genl, genu, gens, genx, kvm, convert to point to /Users/marc/Scripts/MacOS/.
    • 1.5.2 Update Local macOS Crontab (crontab -e): Updated 5 daily scheduled sync jobs to point to /Users/marc/Scripts/MacOS/.
    • 1.5.3 Update Obsidian Documentation Notes: Updated path references in GenDash and Hugo setup on Mac.md, Obsidian and Hugo setup on Mac.md, and KVM-Tripp-Lite.md.
  • 1.6 Commit & Push Consolidated Repository to GitHub

    • Committed consolidated repository (Commit 35a987a) and pushed executable permissions (chmod +x) to git@github.com:marcoue/Scripts.git on branch main.
  • 1.7 Install Automated NAS Mirroring Hook (post-commit)

    • Created executable Git post-commit hook in /Users/marc/Scripts/.git/hooks/post-commit. Tested and verified auto-syncing 100% of committed files to UNAS-Pro (/Volumes/Software/Software/Scripts/).

4. TrueNAS Backup Scripts Migration Reference#

The creation of modular TrueNAS backup scripts (HP1_UNAS_Pull_Backup.sh, HP2_UNAS_Pull_Backup.sh, HP3_UNAS_Pull_Backup.sh, HP7_UNAS_Pull_Backup.sh, HP8_UNAS_Pull_Backup.sh) and their TrueNAS Cron Job bootstrap integration have been consolidated into the master backup plan:

👉 Unifi UNAS-Pro Backup Migration Plan: Section 5


5. Verification & Audit Protocol#

  • Verify Master Local Repo: git status in /Users/marc/Scripts shows Your branch is up to date with 'origin/main'.
  • Verify NAS Auto-Mirroring: Committing in ~/Scripts/ automatically updates /Volumes/Software/Software/Scripts/.
  • Verify Server Pull Execution: Remote TrueNAS nodes pull and execute scripts from Software/Scripts/TrueNAS/ (managed via Unifi UNAS-Pro Backup Migration Plan).