Add daily timezone drift check

tz-drift-check.sh + sky-cam-tzcheck timer notify when TIMEZONE no longer
matches the machine's timezone (timers follow the machine, scripts follow TIMEZONE).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013wi3ZRpfenCe2TRwT4JFMG
This commit is contained in:
Claude
2026-11-02 02:54:07 +00:00
parent 63bbe5c2ab
commit 5e1cb8857d
2 changed files with 68 additions and 0 deletions
+19
View File
@@ -296,6 +296,25 @@ for cam in "${CAMERAS[@]}"; do
fi
done
# ── Timezone drift check ─────────────────────────────────────────────────────
# Daily + shortly after boot: notify if TIMEZONE no longer matches the
# machine's timezone (systemd timers follow the machine, scripts follow TIMEZONE).
write_service "sky-cam-tzcheck" "timezone drift check" "tz-drift-check.sh"
cat > "$UNIT_DIR/sky-cam-tzcheck.timer" <<EOF2
[Unit]
Description=Sky-Cam — timezone drift check
[Timer]
OnBootSec=3min
OnCalendar=*-*-* 12:00:00
Persistent=true
[Install]
WantedBy=timers.target
EOF2
echo " wrote sky-cam-tzcheck.timer"
timers+=("sky-cam-tzcheck")
# ── Generate .env.example ────────────────────────────────────────────────────
env_example="$HERE/.env.example"
{