[object Object]

← back to Re Flyer Aggregator

reflyers: auto-sync fresh viewer data to Kamatera prod after each dtt-cron run (item 1 freshness)

3bbdac881923c46859ce0537f529106b7dee9539 · 2026-08-20 09:25:24 -0700 · Steve Abrams

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Files touched

Diff

commit 3bbdac881923c46859ce0537f529106b7dee9539
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Thu Aug 20 09:25:24 2026 -0700

    reflyers: auto-sync fresh viewer data to Kamatera prod after each dtt-cron run (item 1 freshness)
    
    Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---
 scripts/dtt-cron.sh                     |  2 ++
 scripts/sync-viewer-data-to-kamatera.sh | 17 +++++++++++++++++
 2 files changed, 19 insertions(+)

diff --git a/scripts/dtt-cron.sh b/scripts/dtt-cron.sh
index c18af04..3696cea 100755
--- a/scripts/dtt-cron.sh
+++ b/scripts/dtt-cron.sh
@@ -14,4 +14,6 @@ node scripts/ingest-la-sales.mjs >> "$LOG" 2>&1
 node scripts/build-flyers-site.mjs >> "$LOG" 2>&1
 # 5) Email the morning's NEW closed deals to Steve via George (only if there are any)
 bash scripts/email-digest.sh >> "$LOG" 2>&1
+# 6) Push the fresh viewer data to the LIVE Kamatera re-flyers-viewer (/search + /)
+bash scripts/sync-viewer-data-to-kamatera.sh >> "$LOG" 2>&1
 echo "--- exit $? ---" >> "$LOG"
diff --git a/scripts/sync-viewer-data-to-kamatera.sh b/scripts/sync-viewer-data-to-kamatera.sh
new file mode 100755
index 0000000..a1b00ad
--- /dev/null
+++ b/scripts/sync-viewer-data-to-kamatera.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+# Push the fresh /search + / viewer data to the LIVE Kamatera re-flyers-viewer
+# (pm2 re-flyers-viewer :9906, https://reflyers.designerwallcoverings.com).
+# Called at the end of dtt-cron.sh (4x/day) so prod tracks Mac2's regen. $0 (local rsync).
+# Data-only: the app code/HTML/nav-agent is deployed separately; this ships just the JSON.
+set -euo pipefail
+export PATH="/opt/homebrew/bin:/usr/bin:/bin:/usr/sbin:/sbin"
+cd "$(dirname "$0")/.."
+DEST=root@45.61.58.125:/root/public-projects/re-flyer-aggregator
+# -R preserves each file's relative path, so they land at the matching prod path in one pass.
+rsync -azR -e ssh \
+  public/flyers/flyers.json \
+  data/article-archive.json \
+  public/sources.json \
+  public/advertising/broker-ad-signals.json \
+  "$DEST/"
+echo "synced viewer data to Kamatera $(date '+%Y-%m-%d %H:%M:%S')"

← b12f6f0 chore: lint + light refactor of news/property scripts (sessi  ·  back to Re Flyer Aggregator  ·  reflyers: deploy deal-assets viewer (server.js) + auto-refre 6e761c7 →