From ccfeacbe910a591ac5a79b24281e4b8dbfa00607 Mon Sep 17 00:00:00 2001 From: Ben Reed Date: Mon, 18 Aug 2025 21:52:28 -0300 Subject: [PATCH] Fix NAS sync to include media files instead of logs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Changed NAS sync from logs to media directory - Media files (images, videos, audio) are much more valuable for backup - Logs are better kept locally for debugging and monitoring - Uses rsync -av --delete for media synchronization - Maintains proper error handling and reporting NAS structure now: - /mnt/nas/hvacknowitall/current/ (latest markdown) - /mnt/nas/hvacknowitall/archives/ (historical archives) - /mnt/nas/hvacknowitall/media/ (downloaded media files) 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- src/orchestrator.py | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/orchestrator.py b/src/orchestrator.py index c9ce2cb..0d35783 100644 --- a/src/orchestrator.py +++ b/src/orchestrator.py @@ -294,23 +294,24 @@ class ContentOrchestrator: print(f"✅ Archive files synced to {nas_archives}") - # Sync logs (last 7 days) - if self.logs_dir.exists(): - nas_logs = self.nas_path / "logs" - nas_logs.mkdir(parents=True, exist_ok=True) + # Sync media files + media_dir = self.data_dir / "media" + if media_dir.exists(): + nas_media = self.nas_path / "media" + nas_media.mkdir(parents=True, exist_ok=True) cmd = [ - 'rsync', '-av', '--include=*.log', - '--exclude=*', '--delete', - f"{self.logs_dir}/", - f"{nas_logs}/" + 'rsync', '-av', '--delete', + f"{media_dir}/", + f"{nas_media}/" ] result = subprocess.run(cmd, capture_output=True, text=True) if result.returncode != 0: - print(f"⚠️ Log sync failed (non-critical): {result.stderr}") - else: - print(f"✅ Logs synced to {nas_logs}") + print(f"❌ Media sync failed: {result.stderr}") + return False + + print(f"✅ Media files synced to {nas_media}") return True