← back to Marketing Command Center

scripts/ig-repull-SCHEDULE.md

32 lines

# IG media re-pull — schedule

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:

    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 + a manual
"Run now" fix-it button, kept as a fallback for an ad-hoc re-pull between the
hourly cron ticks).

## 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.