Fix to transfer
This commit is contained in:
+19
-3
@@ -18,6 +18,15 @@ Design:
|
||||
Sync model: move everything, exclude a small denylist. The exclusions are large
|
||||
derived artifacts each side regenerates or ships on its own (rendered output,
|
||||
preprocessed segments, downscales, chunk scratch), so they never travel over SSH.
|
||||
|
||||
Master = the machine's local tree. The PROJECT sync runs with rsync --delete, so a
|
||||
file deleted locally and then `up`'d is removed on the server, and `down` mirrors the
|
||||
server onto the local tree (deletions included). The Mac is the intended master: it
|
||||
`up`s, the rig `down`s. Excluded paths are PROTECTED from --delete (rsync does not
|
||||
touch excluded files on the receiver), so rig-only artifacts — above all the big
|
||||
`*_processed.*` preprocess outputs — are never deleted by a mirror from the Mac.
|
||||
Shared assets are NOT --deleted (a cross-project library; blind deletion could wipe
|
||||
pexels downloaded on the other side), so that pass stays purely additive.
|
||||
"""
|
||||
|
||||
import json
|
||||
@@ -52,6 +61,7 @@ _SYNC_EXCLUDES = [
|
||||
"media/narration/proxy/",
|
||||
"media/videos/proxy/",
|
||||
"**/chunks/",
|
||||
"*_processed.*", # preprocess outputs — rig-only, never transfer OR --delete them
|
||||
"*.tmp",
|
||||
".*", # rsync in-progress temp files (.filename.XXXXXX) and .DS_Store
|
||||
]
|
||||
@@ -147,9 +157,11 @@ def cmd_up(project_path: Path, verbose: bool, dry_run: bool) -> int:
|
||||
shared_root = _find_shared_assets_root(project_path)
|
||||
remote_shared = f"{server['path']}/shared_assets"
|
||||
|
||||
# Pass 1: project files — whole tree, denylist excludes.
|
||||
# Pass 1: project files — whole tree, denylist excludes. --delete mirrors the local
|
||||
# (master) tree onto the server: files deleted locally are removed there too.
|
||||
# Excluded paths (processed outputs, out/, chunks, …) are protected from deletion.
|
||||
rsync_cmd = [
|
||||
"rsync", "-av", "--progress",
|
||||
"rsync", "-av", "--progress", "--delete",
|
||||
"-e", f"ssh -p {server['port']}",
|
||||
*[f"--exclude={p}" for p in _SYNC_EXCLUDES],
|
||||
f"{project_path}/",
|
||||
@@ -228,8 +240,12 @@ def cmd_down(project_path: Path, verbose: bool, dry_run: bool) -> int:
|
||||
|
||||
project_path.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
# --delete mirrors the server (which the master `up`'d) onto this local tree:
|
||||
# files gone from the server are removed here too. Excluded paths — above all the
|
||||
# rig-only *_processed.* outputs — are protected, so a `down` on the rig never
|
||||
# deletes its own preprocess artifacts.
|
||||
rsync_cmd = [
|
||||
"rsync", "-av", "--progress",
|
||||
"rsync", "-av", "--progress", "--delete",
|
||||
"-e", f"ssh -p {server['port']}",
|
||||
*[f"--exclude={p}" for p in _SYNC_EXCLUDES],
|
||||
f"{server['user']}@{server['host']}:{remote_project}/",
|
||||
|
||||
Reference in New Issue
Block a user