[object Object]

← back to Marketing Command Center

MCC IG re-pull: hourly 6am-6pm cron cadence (was daily), board staleness threshold 14h

059034ea9f73c6fb102bcee96bdcf86eae3dfee8 · 2026-08-25 08:51:52 -0700 · Steve Abrams

Change the ig-media-repull job from daily 06:40 to hourly 06:00-18:00 (0 6-18 * * *)
so published-IG board thumbnails stay durable through the workday and refresh again
each morning at 6am. Board health-strip staleness threshold 36h->14h (tolerates the
intended 18:00->06:00 overnight sleep; errors still show red). Doc carries the exact
apply + revert crontab one-liners for Kamatera.

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

Files touched

Diff

commit 059034ea9f73c6fb102bcee96bdcf86eae3dfee8
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Tue Aug 25 08:51:52 2026 -0700

    MCC IG re-pull: hourly 6am-6pm cron cadence (was daily), board staleness threshold 14h
    
    Change the ig-media-repull job from daily 06:40 to hourly 06:00-18:00 (0 6-18 * * *)
    so published-IG board thumbnails stay durable through the workday and refresh again
    each morning at 6am. Board health-strip staleness threshold 36h->14h (tolerates the
    intended 18:00->06:00 overnight sleep; errors still show red). Doc carries the exact
    apply + revert crontab one-liners for Kamatera.
    
    Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---
 modules/channels/index.js     |  3 ++-
 public/panels/board.js        | 10 +++++++---
 scripts/ig-repull-SCHEDULE.md | 33 ++++++++++++++++++++++++++-------
 3 files changed, 35 insertions(+), 11 deletions(-)

diff --git a/modules/channels/index.js b/modules/channels/index.js
index bdff7d5..909fb4a 100644
--- a/modules/channels/index.js
+++ b/modules/channels/index.js
@@ -819,7 +819,8 @@ module.exports = {
     // any missing so the next load self-heals. Never blocks the response.
     router.get('/outbox', (_req, res) => res.json({ items: mediaCache.localizeItems(readOutbox().slice(-100).reverse()) }));
     // IG media re-pull health: the board shows last-run time + result at a glance
-    // (see scripts/ig-media-repull.js, run daily by com.steve.mcc-ig-repull).
+    // (see scripts/ig-media-repull.js, run hourly 6am-6pm by the Kamatera cron
+    // "mcc-ig-repull"; see scripts/ig-repull-SCHEDULE.md).
     const REPULL_STATUS = path.join(__dirname, '..', '..', 'data', 'ig-repull-status.json');
     router.get('/ig-repull-status', (_req, res) => {
       try { res.json(JSON.parse(fs.readFileSync(REPULL_STATUS, 'utf8'))); }
diff --git a/public/panels/board.js b/public/panels/board.js
index 87876bc..f3df4d6 100644
--- a/public/panels/board.js
+++ b/public/panels/board.js
@@ -33,8 +33,12 @@ window.MCC_PANELS['board'] = {
 
     // ── IG re-pull health strip (job that keeps published-IG thumbnails durable) ──
     // Inserted once above the board; shows last-run time + result + a health dot,
-    // and a "Run now" fix-it button. Amber if stale (>36h) or never run, red on
-    // Graph/download errors, green when the last run completed clean.
+    // and a "Run now" fix-it button. The job runs hourly 6am–6pm on Kamatera cron;
+    // amber if stale or never run, red on Graph/download errors, green when the last
+    // run completed clean. Staleness threshold is 14h (NOT ~1h): the cron sleeps
+    // 18:00→06:00 by design (a ~12h gap), so a tighter threshold would flag amber
+    // every night; 14h only trips if the morning runs are actually missed. A genuine
+    // failure during the day still shows red via s.ok===false regardless.
     if (!$('#bd-repull-health')) {
       const strip = document.createElement('div');
       strip.id = 'bd-repull-health';
@@ -49,7 +53,7 @@ window.MCC_PANELS['board'] = {
       let dot = '#4a8f5f', label; // green
       if (!s.ranAt) { dot = '#c9a227'; label = 'never run'; }
       else if (s.ok === false) { dot = '#c0392b'; label = `error (graphErr ${s.graphErr}, dead ${s.downloadDead})`; }
-      else if (ageH > 36) { dot = '#c9a227'; label = `stale — last ran ${fmtWhen(s.ranAt)}`; }
+      else if (ageH > 14) { dot = '#c9a227'; label = `stale — last ran ${fmtWhen(s.ranAt)}`; }
       else label = `ran ${fmtWhen(s.ranAt)} · ${s.recovered || 0} recovered`;
       healthEl.innerHTML =
         `<span style="width:9px;height:9px;border-radius:50%;background:${dot};flex:0 0 auto"></span>` +
diff --git a/scripts/ig-repull-SCHEDULE.md b/scripts/ig-repull-SCHEDULE.md
index 5bb0ceb..a2e3f57 100644
--- a/scripts/ig-repull-SCHEDULE.md
+++ b/scripts/ig-repull-SCHEDULE.md
@@ -1,12 +1,31 @@
 # IG media re-pull — schedule
 
-Runs **daily 06:40 on Kamatera** via root crontab (self-contained; the script and
-its data both live on Kamatera, so no cross-machine dependency):
+Runs **hourly from 6am to 6pm on Kamatera** via root crontab (self-contained; the
+script and its data both live on Kamatera, so no cross-machine dependency). The
+`6-18` hour range fires on the hour at 06:00, 07:00, … 18:00 (13 runs/day) and
+repeats every day — so it "refreshes next morning at 6am" automatically:
 
-    40 6 * * * cd /root/DW-Agents/marketing-command-center && /usr/bin/node scripts/ig-media-repull.js --apply >> /root/DW-Agents/logs/mcc-ig-repull.log 2>&1  # mcc-ig-repull
+    0 6-18 * * * cd /root/DW-Agents/marketing-command-center && /usr/bin/node scripts/ig-media-repull.js --apply >> /root/DW-Agents/logs/mcc-ig-repull.log 2>&1  # mcc-ig-repull
 
-The board shows the last run at a glance (IG re-pull health strip + Run-now button).
+The board shows the last run at a glance (IG re-pull health strip + a manual
+"Run now" fix-it button, kept as a fallback for an ad-hoc re-pull between the
+hourly cron ticks).
 
-History: was a Mac2 launchd job (com.steve.mcc-ig-repull) SSHing into Kamatera;
-moved to a Kamatera-local cron 2026-07-22 to drop the needless Mac2 dependency
-(a Mac2-asleep/SSH-hiccup at run time would have silently skipped it).
+## Apply / update on Kamatera (idempotent — drops any prior mcc-ig-repull line first)
+
+    ( crontab -l 2>/dev/null | grep -v 'mcc-ig-repull'; \
+      echo '0 6-18 * * * cd /root/DW-Agents/marketing-command-center && /usr/bin/node scripts/ig-media-repull.js --apply >> /root/DW-Agents/logs/mcc-ig-repull.log 2>&1  # mcc-ig-repull' \
+    ) | crontab - && crontab -l | grep mcc-ig-repull
+
+Revert to the previous daily cadence:
+
+    ( crontab -l 2>/dev/null | grep -v 'mcc-ig-repull'; \
+      echo '40 6 * * * cd /root/DW-Agents/marketing-command-center && /usr/bin/node scripts/ig-media-repull.js --apply >> /root/DW-Agents/logs/mcc-ig-repull.log 2>&1  # mcc-ig-repull' \
+    ) | crontab - && crontab -l | grep mcc-ig-repull
+
+History:
+- Was a Mac2 launchd job (com.steve.mcc-ig-repull) SSHing into Kamatera; moved to a
+  Kamatera-local cron 2026-07-22 to drop the needless Mac2 dependency (a
+  Mac2-asleep/SSH-hiccup at run time would have silently skipped it).
+- 2026-08-25: daily 06:40 → hourly 06:00–18:00 (`0 6-18 * * *`) so published-IG
+  thumbnails stay durable through the workday instead of once each morning.

← 0fd3052 auto-data-snapshot: 2026-08-24T20:06:56 (1 data files) — pub  ·  back to Marketing Command Center  ·  auto-data-snapshot: 2026-08-25T08:55:17 (1 data files) — pub aa6a459 →