← back to Dw Activation Calendar

regen.sh

13 lines

#!/bin/zsh
# Daily re-projection of the SKU activation schedule: re-stamps every staged
# item's go-live DATE+TIME against the current worklist (items already drained
# drop out, remaining items get fresh slots). Idempotent, read-only vs dw_unified.
set -u
export PATH="/opt/homebrew/opt/postgresql@14/bin:/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
DIR="$HOME/Projects/dw-activation-calendar"
LOG="$DIR/regen.log"
cd "$DIR" || exit 1
echo "[$(date '+%Y-%m-%d %H:%M:%S')] regen start" >>"$LOG"
node scripts/generate-schedule.js >>"$LOG" 2>&1
echo "[$(date '+%Y-%m-%d %H:%M:%S')] regen end rc=$?" >>"$LOG"