static-file size/manifest: match offloaded (symlinked) dirs + show offload indicator
find -type d skipped static dirs that are already offloaded (a symlink to /slowdisk is type l, not d) — so show-static-file-size.sh reported zero static for an offloaded node (e.g. bob on de-35), and backup-node.sh would drop them from the manifest (breaking re-offload on the next restore). Match dirs AND symlinks now (root-level entries too). show-static-file-size.sh also tags each static dir with its location: [OFFLOADED -> /slowdisk/...], [on-disk], or [BROKEN SYMLINK ...]. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -42,11 +42,14 @@ generate_volume_metadata() {
|
||||
# slash is a path-suffix, so any prefix matches (network-prefixed nitro freezers,
|
||||
# nested l2geth geth/geth/...). Record the CONCRETE relative path so restore-volumes
|
||||
# can recreate the exact static-file -> /slowdisk symlink.
|
||||
# Match real dirs AND symlinks: an already-OFFLOADED static dir is a symlink to
|
||||
# /slowdisk, which find -type d alone would skip (then it would be dropped from the
|
||||
# manifest and the next restore would not re-offload it).
|
||||
local matches=() m rel
|
||||
if [[ "$path" == */* ]]; then
|
||||
while IFS= read -r m; do matches+=("$m"); done < <(find "$prefix/_data" -type d -path "*/$path" 2>/dev/null)
|
||||
while IFS= read -r m; do matches+=("$m"); done < <(find "$prefix/_data" \( -type d -o -type l \) -path "*/$path" 2>/dev/null)
|
||||
else
|
||||
[[ -d "$prefix/_data/$path" ]] && matches+=("$prefix/_data/$path")
|
||||
m="$prefix/_data/$path"; { [ -d "$m" ] || [ -L "$m" ]; } && matches+=("$m")
|
||||
fi
|
||||
for m in "${matches[@]}"; do
|
||||
rel="${m#"$prefix/_data/"}"
|
||||
|
||||
Reference in New Issue
Block a user