← back to Commercialrealestate
Daily valley-pools refresh now pushes the fresh snapshot to prod
036e4b589e2c004945782421b9ac626fbabe94e3 · 2026-08-19 12:49:19 -0700 · Steve Abrams
refresh-valley-pools.sh: regenerate on Mac2 (keeps the cre.sfr price-history +
$/sqft enrichment the DB-less prod box can't do), sanity-gate on count>0, then
rsync valley-pools.json to prod so crcp.agentabrams.com stays fresh. Launchd job
com.steve.valley-pools-refresh now runs this wrapper (was calling node directly).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Files touched
A scripts/refresh-valley-pools.sh
Diff
commit 036e4b589e2c004945782421b9ac626fbabe94e3
Author: Steve Abrams <steve@designerwallcoverings.com>
Date: Wed Aug 19 12:49:19 2026 -0700
Daily valley-pools refresh now pushes the fresh snapshot to prod
refresh-valley-pools.sh: regenerate on Mac2 (keeps the cre.sfr price-history +
$/sqft enrichment the DB-less prod box can't do), sanity-gate on count>0, then
rsync valley-pools.json to prod so crcp.agentabrams.com stays fresh. Launchd job
com.steve.valley-pools-refresh now runs this wrapper (was calling node directly).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---
scripts/refresh-valley-pools.sh | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/scripts/refresh-valley-pools.sh b/scripts/refresh-valley-pools.sh
new file mode 100755
index 0000000..6ef7b29
--- /dev/null
+++ b/scripts/refresh-valley-pools.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+# refresh-valley-pools.sh — daily: regenerate the SFV pool-homes snapshot on Mac2 (WITH the cre.sfr
+# price-history + $/sqft enrichment, which prod's DB-less box can't do), then push the finished
+# JSON up to prod so crcp.agentabrams.com stays fresh. Run by com.steve.valley-pools-refresh.
+set -euo pipefail
+ROOT="/Users/macstudio3/Projects/commercialrealestate"
+NODE="/opt/homebrew/bin/node"
+PROD="root@45.61.58.125:/root/public-projects/commercialrealestate/data/valley-pools.json"
+cd "$ROOT"
+
+# 1) regenerate locally
+"$NODE" scripts/fetch-valley-pools.js
+
+# 2) sanity-gate: valid JSON with a real count before we push (never ship an empty/broken file to prod)
+COUNT=$("$NODE" -e 'try{const j=JSON.parse(require("fs").readFileSync("data/valley-pools.json"));process.stdout.write(String(j.count||0))}catch(e){process.stdout.write("0")}')
+if [ "${COUNT:-0}" -lt 1 ]; then
+ echo "$(date '+%F %T') SKIP push — fetch produced ${COUNT:-0} homes (bad/empty file)" >&2
+ exit 1
+fi
+
+# 3) push the finished snapshot to prod (single file, no deletes)
+rsync -az data/valley-pools.json "$PROD"
+echo "$(date '+%F %T') refreshed + pushed ${COUNT} homes to prod"
← 9bbc693 CRCP gate: multi-credential auth (CRCP_EXTRA_USERS) — add st
·
back to Commercialrealestate
·
auto-data-snapshot: 2026-08-19T12:54:53 (1 data files) — dat cf9fb57 →