← back to Beverlyhillsvideos
poster: sync ledgers to prod calendar after each post + token-health watchdog (com.steve.bhv-token-health, daily, CNCP alert on failure)
591fd08126fda0db2f34dc940cdf3da1134dff62 · 2026-08-06 16:35:22 -0700 · Steve Abrams
Files touched
M social/poster/run.shA social/poster/token-health-run.sh
Diff
commit 591fd08126fda0db2f34dc940cdf3da1134dff62
Author: Steve Abrams <steve@designerwallcoverings.com>
Date: Thu Aug 6 16:35:22 2026 -0700
poster: sync ledgers to prod calendar after each post + token-health watchdog (com.steve.bhv-token-health, daily, CNCP alert on failure)
---
social/poster/run.sh | 5 +++++
social/poster/token-health-run.sh | 12 ++++++++++++
2 files changed, 17 insertions(+)
diff --git a/social/poster/run.sh b/social/poster/run.sh
index b2ae037..ed4de71 100755
--- a/social/poster/run.sh
+++ b/social/poster/run.sh
@@ -14,3 +14,8 @@ LOG="social/poster/post.log"
echo "----- $(date '+%Y-%m-%d %H:%M:%S %Z') · slot=$SLOT kind=$KIND -----" >> "$LOG"
BHV_IG_KIND="$KIND" /opt/homebrew/bin/node social/poster/post-daily.mjs >> "$LOG" 2>&1
echo "exit: $?" >> "$LOG"
+
+# Keep calendar.agentabrams.com current: push the updated ledgers to the prod calendar
+# (best-effort, non-blocking — the calendar reads these as its bundled fallback).
+rsync -az social/poster/ledger.jsonl social/poster/ledger-store.jsonl \
+ root@45.61.58.125:/root/public-projects/calendar-agentabrams/data/ >> "$LOG" 2>&1 || true
diff --git a/social/poster/token-health-run.sh b/social/poster/token-health-run.sh
new file mode 100755
index 0000000..ab113bc
--- /dev/null
+++ b/social/poster/token-health-run.sh
@@ -0,0 +1,12 @@
+#!/bin/zsh
+# Daily BHV posting watchdog: token health + recent post failures. Alerts via CNCP on trouble.
+cd "$(dirname "$0")/../.." || exit 1
+OUT=$(/opt/homebrew/bin/node social/poster/token-health.mjs 2>&1); RC=$?
+# also flag if the last few post.log runs recorded a live POST FAILED
+FAILS=$(tail -40 social/poster/post.log 2>/dev/null | grep -c "POST FAILED")
+if [[ $RC -ne 0 || $FAILS -gt 0 ]]; then
+ MSG="BHV Instagram watchdog: token=[$OUT] recentPostFailures=$FAILS"
+ curl -s -X POST http://127.0.0.1:3333/api/parking-lot -H 'Content-Type: application/json' \
+ -d "{\"project\":\"beverlyhillsvideos\",\"title\":\"BHV posting needs attention\",\"note\":\"$MSG\"}" >/dev/null 2>&1 || true
+ echo "$(date) ALERT: $MSG" >> social/poster/watchdog.log
+fi
← e150ee7 auto-data-snapshot: 2026-08-06T16:33:58 (2 data files) — soc
·
back to Beverlyhillsvideos
·
auto-data-snapshot: 2026-08-06T18:06:44 (3 data files) — soc 58df939 →