Adding ignoring processed as well

This commit is contained in:
2026-05-09 12:31:17 +02:00
parent f8d359543a
commit d722272edc
+28 -17
View File
@@ -2935,6 +2935,31 @@ def cmd_description(project_path: Path, verbose: bool) -> int:
return 0 return 0
# Files and directories excluded from all sync/archive/load operations.
# Covers intermediate processing artifacts, chunk scratch dirs, venv, and
# common OS/editor noise.
_RSYNC_EXCLUDES = [
# Intermediate processing files
"media/narration/intermediate/",
"media/narration/intermediate/**",
"media/videos/intermediate/",
"media/videos/intermediate/**",
"media/videos/processed/",
"media/videos/processed/**",
# Chunk scratch directories
"**/chunks/",
"**/chunks/**",
# Python
"*.py",
"__pycache__/",
"venv/",
# Version control / OS noise
".git/",
".DS_Store",
"*.tmp",
]
def cmd_archive(project_path: Path, verbose: bool, dry_run: bool) -> int: def cmd_archive(project_path: Path, verbose: bool, dry_run: bool) -> int:
"""Archive project files to external cache storage.""" """Archive project files to external cache storage."""
from .cache import load_cache_config from .cache import load_cache_config
@@ -2963,19 +2988,11 @@ def cmd_archive(project_path: Path, verbose: bool, dry_run: bool) -> int:
if not dry_run: if not dry_run:
dest_path.mkdir(parents=True, exist_ok=True) dest_path.mkdir(parents=True, exist_ok=True)
# Use rsync to sync media files
# -a: archive mode (preserves permissions, timestamps, etc.)
# -v: verbose
# --progress: show progress
# --exclude: skip files we don't want to sync
rsync_cmd = [ rsync_cmd = [
"rsync", "rsync",
"-av", "-av",
"--progress", "--progress",
"--exclude=*.py", *[f"--exclude={p}" for p in _RSYNC_EXCLUDES],
"--exclude=__pycache__",
"--exclude=.git",
"--exclude=.DS_Store",
f"{project_path}/", f"{project_path}/",
f"{dest_path}/", f"{dest_path}/",
] ]
@@ -3052,10 +3069,7 @@ def cmd_load(project_path: Path, verbose: bool, dry_run: bool) -> int:
"rsync", "rsync",
"-av", "-av",
"--progress", "--progress",
"--exclude=*.py", *[f"--exclude={p}" for p in _RSYNC_EXCLUDES],
"--exclude=__pycache__",
"--exclude=.git",
"--exclude=.DS_Store",
f"{src_path}/", f"{src_path}/",
f"{project_path}/", f"{project_path}/",
] ]
@@ -3147,10 +3161,7 @@ def cmd_sync(project_path: Path, verbose: bool, dry_run: bool, download: bool) -
"-av", "-av",
"--progress", "--progress",
"-e", f"ssh -p {server['port']}", "-e", f"ssh -p {server['port']}",
"--exclude=*.py", *[f"--exclude={p}" for p in _RSYNC_EXCLUDES],
"--exclude=__pycache__",
"--exclude=.git",
"--exclude=.DS_Store",
src, src,
dest, dest,
] ]