← back to Commercialrealestate
TK-11856 rc-propagation (RSYNC): crcp-loan-officers exits nonzero on failed prod backup/rsync
0d1c4f8f190526261c8379becb51846322d90241 · 2026-09-26 09:22:34 -0700 · Steve
Exit-code ONLY, no behavior change (Steve ruling 2026-09-26 Q1/Q2): every step still runs as
before; the wrapper now exits with the first nonzero rc of its side-effecting step(s) instead of
swallowing it, so cron-fire-canary's exit corroboration can see a failed run. No heartbeat file added.
Revert: git -C /Users/macstudio3/Projects/commercialrealestate revert <this sha>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YaiWjfgEuKQLTb5cdDreS3
Files touched
M scripts/refresh-loan-officers.sh
Diff
commit 0d1c4f8f190526261c8379becb51846322d90241
Author: Steve <steve@designerwallcoverings.com>
Date: Sat Sep 26 09:22:34 2026 -0700
TK-11856 rc-propagation (RSYNC): crcp-loan-officers exits nonzero on failed prod backup/rsync
Exit-code ONLY, no behavior change (Steve ruling 2026-09-26 Q1/Q2): every step still runs as
before; the wrapper now exits with the first nonzero rc of its side-effecting step(s) instead of
swallowing it, so cron-fire-canary's exit corroboration can see a failed run. No heartbeat file added.
Revert: git -C /Users/macstudio3/Projects/commercialrealestate revert <this sha>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YaiWjfgEuKQLTb5cdDreS3
---
scripts/refresh-loan-officers.sh | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/scripts/refresh-loan-officers.sh b/scripts/refresh-loan-officers.sh
index 59cf5ce..fef6ff0 100755
--- a/scripts/refresh-loan-officers.sh
+++ b/scripts/refresh-loan-officers.sh
@@ -43,9 +43,17 @@ git -c user.email="steve@designerwallcoverings.com" -c user.name="Steve" commit
say "committed $(git rev-parse --short HEAD) (local)"
# 2) AUTO-DEPLOY to prod (owner-authorized) — back up first, rsync only the one data file, verify.
-ssh -o ConnectTimeout=15 "$PROD" "cp $PROD_FILE $PROD_FILE.bak-\$(date +%Y%m%d-%H%M%S)" && say "prod backed up"
-rsync -az --no-perms --no-owner --no-group data/loan-officers.json "$PROD:$PROD_FILE" && say "rsynced to prod"
+# TK-11856 rc-propagation (exit-code ONLY, no behavior change): the backup ssh + rsync were LEFT of
+# `&&`, so under set -e their failure was swallowed and a failed push still exited 0. Same control
+# flow as before (a failed backup still lets the rsync run; the verify still runs), but we REMEMBER the
+# first nonzero rc and exit with it at the end. Undo: git revert.
+FIRST_RC=0
+ssh -o ConnectTimeout=15 "$PROD" "cp $PROD_FILE $PROD_FILE.bak-\$(date +%Y%m%d-%H%M%S)" && say "prod backed up" \
+ || { r=$?; say "prod backup FAILED rc=$r"; if [ "$FIRST_RC" -eq 0 ]; then FIRST_RC=$r; fi; }
+rsync -az --no-perms --no-owner --no-group data/loan-officers.json "$PROD:$PROD_FILE" && say "rsynced to prod" \
+ || { r=$?; say "rsync to prod FAILED rc=$r"; if [ "$FIRST_RC" -eq 0 ]; then FIRST_RC=$r; fi; }
PROD_CHECK=$(ssh -o ConnectTimeout=15 "$PROD" "python3 -c \"import json;d=json.load(open('$PROD_FILE'));o=d['officers'];bad=[x for x in o if any(k in x for k in ('address_line_1','address_line_2','zip_code','zip'))];print(len(o),'PII_LEAK' if bad else 'clean')\"")
say "prod verify: $PROD_CHECK"
case "$PROD_CHECK" in *PII_LEAK*) say "WARNING: prod shows a PII field — investigate";; esac
-say "=== refresh done (deployed) ==="
+say "=== refresh done (deployed) rc=$FIRST_RC ==="
+exit "$FIRST_RC"
← 6e70efd auto-data-snapshot: 2026-09-26T07:18:02 (1 data files) — dat
·
back to Commercialrealestate
·
TK-11856 rc-propagation (EMAIL): CRE residential/morning/aft 6abfd33 →