0_SYNC

Multi-Host Linux Synchronization Architecture

What It Does

  • Real-time file synchronization across 6+ Linux hosts
  • Git-aware conflict detection and resolution
  • AI-powered merge via Claude API fallback
  • Daemon-based with 15-second sync intervals

Tech Stack

  • Bash (core engine)
  • rsync over SSH with persistent sockets
  • Git integration (untracked file sync)
  • Claude API (conflict resolution)
6+
Synchronized Hosts
15s
Daemon Interval
7
Sync Engines
AI
Conflict Resolution

Problem Statement

Working across multiple Linux machines (WSL instances, bare-metal servers, cloud VMs) creates a constant challenge: keeping shell environments, scripts, project code, and configurations in sync. Traditional solutions (git alone, cloud sync tools) don't handle the nuance of development workflows — untracked files, environment-specific configs, or real-time shell customizations.

Architecture Overview

┌─────────────────────────────────────────────────────────────────────┐ │ 0_SYNC Architecture │ ├─────────────────────────────────────────────────────────────────────┤ │ │ │ ┌─────────────┐ rsync/SSH ┌─────────────┐ │ │ │ officewsl │◄─────────────►│ server │ │ │ │ (sync hub) │ │ (192.168. │ │ │ └──────┬───────┘ │ 10.15) │ │ │ │ └──────────────┘ │ │ │ rsync/SSH │ │ ├──────────────────────►┌──────────────┐ │ │ │ │ dellserver │ │ │ │ └──────────────┘ │ │ │ │ │ ├──────────────────────►┌──────────────┐ │ │ │ │ app1 │ │ │ │ └──────────────┘ │ │ │ │ │ ├──────────────────────►┌──────────────┐ │ │ │ │ laptopwsl │ │ │ │ └──────────────┘ │ │ │ │ │ └──────────────────────►┌──────────────┐ │ │ │ aws1 / etc. │ │ │ └──────────────┘ │ │ │ │ ┌─────────────────────────────────────────────────────────────┐ │ │ │ Sync Engines │ │ │ ├─────────────────────────────────────────────────────────────┤ │ │ │ sync_environment.sh │ Bash env (.bashrc, aliases) 15s │ │ │ │ sync_wsl_linux.sh │ WSL ↔ Linux (bidirectional) │ │ │ │ sync_project.sh │ Project code (git-aware) │ │ │ │ sync_SCRIPTS.sh │ 0_SCRIPTS directory │ │ │ │ sync_HUBITAT.sh │ Smart home configs │ │ │ │ sync_elfege.com.sh │ Portfolio website │ │ │ │ sync_arduino.sh │ Arduino/IoT projects │ │ │ └─────────────────────────────────────────────────────────────┘ │ │ │ │ ┌─────────────────────────────────────────────────────────────┐ │ │ │ Conflict Resolution │ │ │ ├─────────────────────────────────────────────────────────────┤ │ │ │ 1. MD5 checksum comparison │ │ │ │ 2. 3-way diff3 merge │ │ │ │ 3. Claude API merge (AI fallback) │ │ │ │ 4. Archive + manual review │ │ │ └─────────────────────────────────────────────────────────────┘ │ │ │ └─────────────────────────────────────────────────────────────────────┘

Sync Engines

Engine Purpose Mode
sync_environment.sh Shell environment files (.bashrc, .bash_aliases, .bash_utils) Daemon (15s loop) + cron
sync_wsl_linux.sh Full WSL ↔ Linux bidirectional sync On-demand
sync_project.sh Project code with git-aware conflict detection On-demand (git-only default)
sync_SCRIPTS.sh 0_SCRIPTS directory across all hosts On-demand
sync_HUBITAT.sh Smart home automation configurations On-demand
sync_elfege.com.sh Portfolio website deployment On-demand
sync_arduino.sh Arduino/IoT project files On-demand

Key Design Decisions

Management

Command Effect
pause_all.sh Pause all sync daemons (writes state file)
stop_all_syncs.sh Kill all running sync processes
toggle_git_sync_only.sh Toggle git-only mode (propagates to all hosts)