← back to Marketing Command Center
chore(mcc): daily launchd job for the IG media re-pull (Mac2 → Kamatera SSH)
6d2f55b474e41d69050d13fde0d27f622135f869 · 2026-07-22 11:25:17 -0700 · Steve Abrams
scripts/ig-repull-cron.sh: wrapper the LaunchAgent runs — SSHes to Kamatera and
runs ig-media-repull.js --apply, logging to ~/.claude/logs/mcc-ig-repull.log.
scripts/com.steve.mcc-ig-repull.plist: reference copy of the installed LaunchAgent
(runs daily 06:20; the live copy lives in ~/Library/LaunchAgents). Matches the DW
scheduled-ops pattern (launchd on Mac2 SSHing to Kamatera, like the canaries).
Bootstrapped + kick-tested end-to-end: SSH → --apply → exit 0.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Files touched
A scripts/com.steve.mcc-ig-repull.plistA scripts/ig-repull-cron.sh
Diff
commit 6d2f55b474e41d69050d13fde0d27f622135f869
Author: Steve Abrams <steve@designerwallcoverings.com>
Date: Wed Jul 22 11:25:17 2026 -0700
chore(mcc): daily launchd job for the IG media re-pull (Mac2 → Kamatera SSH)
scripts/ig-repull-cron.sh: wrapper the LaunchAgent runs — SSHes to Kamatera and
runs ig-media-repull.js --apply, logging to ~/.claude/logs/mcc-ig-repull.log.
scripts/com.steve.mcc-ig-repull.plist: reference copy of the installed LaunchAgent
(runs daily 06:20; the live copy lives in ~/Library/LaunchAgents). Matches the DW
scheduled-ops pattern (launchd on Mac2 SSHing to Kamatera, like the canaries).
Bootstrapped + kick-tested end-to-end: SSH → --apply → exit 0.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---
scripts/com.steve.mcc-ig-repull.plist | 24 ++++++++++++++++++++++++
scripts/ig-repull-cron.sh | 18 ++++++++++++++++++
2 files changed, 42 insertions(+)
diff --git a/scripts/com.steve.mcc-ig-repull.plist b/scripts/com.steve.mcc-ig-repull.plist
new file mode 100644
index 0000000..92427be
--- /dev/null
+++ b/scripts/com.steve.mcc-ig-repull.plist
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>Label</key>
+ <string>com.steve.mcc-ig-repull</string>
+ <key>ProgramArguments</key>
+ <array>
+ <string>/bin/zsh</string>
+ <string>/Users/macstudio3/Projects/marketing-command-center/scripts/ig-repull-cron.sh</string>
+ </array>
+ <key>StartCalendarInterval</key>
+ <dict>
+ <key>Hour</key><integer>6</integer>
+ <key>Minute</key><integer>20</integer>
+ </dict>
+ <key>RunAtLoad</key>
+ <false/>
+ <key>StandardOutPath</key>
+ <string>/Users/macstudio3/.claude/logs/mcc-ig-repull.out</string>
+ <key>StandardErrorPath</key>
+ <string>/Users/macstudio3/.claude/logs/mcc-ig-repull.err</string>
+</dict>
+</plist>
diff --git a/scripts/ig-repull-cron.sh b/scripts/ig-repull-cron.sh
new file mode 100755
index 0000000..b87663f
--- /dev/null
+++ b/scripts/ig-repull-cron.sh
@@ -0,0 +1,18 @@
+#!/bin/zsh
+# Daily IG media re-pull — runs ON Kamatera (where the live outbox + tokens live)
+# from a Mac2 launchd LaunchAgent (com.steve.mcc-ig-repull), matching the DW
+# scheduled-ops pattern (launchd on Mac2 SSHing to Kamatera, like the canaries).
+#
+# It refreshes any SUCCESSFULLY-published Instagram post whose stored mediaUrl is
+# an expiring ig/fbcdn signed URL into a durable local /cache/media copy, before
+# that URL 403s and the thumbnail blanks. Stable non-IG URLs are left untouched
+# (--apply targeting only touches at-risk images). Safe to run daily / idempotent:
+# already-localized items are skipped, and it backs up the outbox before writing.
+LOG="$HOME/.claude/logs/mcc-ig-repull.log"
+mkdir -p "$(dirname "$LOG")"
+{
+ echo "===== $(date '+%Y-%m-%d %H:%M:%S %Z') ====="
+ ssh -o BatchMode=yes -o ConnectTimeout=20 root@45.61.58.125 \
+ 'cd /root/DW-Agents/marketing-command-center && node scripts/ig-media-repull.js --apply'
+ echo "exit=$?"
+} >> "$LOG" 2>&1
← 214b1bb fix(mcc): IG re-pull only touches at-risk images, never clob
·
back to Marketing Command Center
·
feat(mcc): board shows IG re-pull health at a glance + Run-n 21be5cc →