← back to Builds Nightly
add backfill.sh + nightly launchd cron (23:50 daily)
a5e96389d65f3f5f99667b720c2bf2e3418c8245 · 2026-07-22 22:20:56 -0700 · Steve Abrams
Files touched
A backfill.shA nightly-run.sh
Diff
commit a5e96389d65f3f5f99667b720c2bf2e3418c8245
Author: Steve Abrams <steve@designerwallcoverings.com>
Date: Wed Jul 22 22:20:56 2026 -0700
add backfill.sh + nightly launchd cron (23:50 daily)
---
backfill.sh | 29 +++++++++++++++++++++++++++++
nightly-run.sh | 5 +++++
2 files changed, 34 insertions(+)
diff --git a/backfill.sh b/backfill.sh
new file mode 100755
index 0000000..b330d7b
--- /dev/null
+++ b/backfill.sh
@@ -0,0 +1,29 @@
+#!/usr/bin/env bash
+# Backfill nightly build films from TODAY backwards to builds.aa's creation (2026-05-27).
+# Skips days already built (out/<day>.mp4) and days with zero wins. Shows running $ cost.
+# Usage: bash backfill.sh [START_YYYY-MM-DD] [END_YYYY-MM-DD] (defaults: today -> 2026-05-27)
+set -uo pipefail
+export PATH="/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:$PATH"
+SELF="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+
+START="${1:-$(date +%Y-%m-%d)}"
+END="${2:-2026-05-27}" # builds.aa first commit
+log() { printf '[%s] %s\n' "$(date +%H:%M:%S)" "$*"; }
+
+# iterate day by day, newest first
+cur="$START"; built=0; skipped=0; empty=0; cost=0
+while :; do
+ if [[ -s "$SELF/out/$cur.mp4" ]]; then
+ log "$cur already built — skip"; skipped=$((skipped+1))
+ else
+ res="$(bash "$SELF/build-day.sh" "$cur" 2>>"$SELF/backfill.log")" || res="ERR:$cur"
+ case "$res" in
+ OK:*) built=$((built+1)); cost=$(python3 -c "print(round($cost+0.11,2))"); log "$cur ✓ built ($res) ~\$$cost total" ;;
+ SKIP:*) empty=$((empty+1)); log "$cur · no wins" ;;
+ *) log "$cur ✗ $res (see backfill.log)" ;;
+ esac
+ fi
+ [[ "$cur" == "$END" ]] && break
+ cur="$(date -j -v-1d -f %Y-%m-%d "$cur" +%Y-%m-%d 2>/dev/null)" || break
+done
+log "BACKFILL DONE — built:$built skipped:$skipped empty:$empty ~\$$cost ElevenLabs"
diff --git a/nightly-run.sh b/nightly-run.sh
new file mode 100755
index 0000000..4ec42b5
--- /dev/null
+++ b/nightly-run.sh
@@ -0,0 +1,5 @@
+#!/usr/bin/env bash
+# Nightly: build + deploy TODAY's build film. Invoked by launchd com.steve.builds-nightly at 23:50.
+export PATH="/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:$PATH"
+SELF="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+exec bash "$SELF/build-day.sh" "$(date +%Y-%m-%d)" >> "$SELF/nightly.log" 2>&1
← 8601a05 builds-nightly pipeline: CNCP wins -> ElevenLabs voice -> Hy
·
back to Builds Nightly
·
fix: manifest print to stderr so backfill/nightly case-match df39fea →