Fix NAS sync to include media files instead of logs
- 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 <noreply@anthropic.com>
This commit is contained in:
parent
afdc790415
commit
ccfeacbe91
1 changed files with 12 additions and 11 deletions
|
|
@ -294,23 +294,24 @@ class ContentOrchestrator:
|
||||||
|
|
||||||
print(f"✅ Archive files synced to {nas_archives}")
|
print(f"✅ Archive files synced to {nas_archives}")
|
||||||
|
|
||||||
# Sync logs (last 7 days)
|
# Sync media files
|
||||||
if self.logs_dir.exists():
|
media_dir = self.data_dir / "media"
|
||||||
nas_logs = self.nas_path / "logs"
|
if media_dir.exists():
|
||||||
nas_logs.mkdir(parents=True, exist_ok=True)
|
nas_media = self.nas_path / "media"
|
||||||
|
nas_media.mkdir(parents=True, exist_ok=True)
|
||||||
|
|
||||||
cmd = [
|
cmd = [
|
||||||
'rsync', '-av', '--include=*.log',
|
'rsync', '-av', '--delete',
|
||||||
'--exclude=*', '--delete',
|
f"{media_dir}/",
|
||||||
f"{self.logs_dir}/",
|
f"{nas_media}/"
|
||||||
f"{nas_logs}/"
|
|
||||||
]
|
]
|
||||||
|
|
||||||
result = subprocess.run(cmd, capture_output=True, text=True)
|
result = subprocess.run(cmd, capture_output=True, text=True)
|
||||||
if result.returncode != 0:
|
if result.returncode != 0:
|
||||||
print(f"⚠️ Log sync failed (non-critical): {result.stderr}")
|
print(f"❌ Media sync failed: {result.stderr}")
|
||||||
else:
|
return False
|
||||||
print(f"✅ Logs synced to {nas_logs}")
|
|
||||||
|
print(f"✅ Media files synced to {nas_media}")
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue