Date and Time Inputs
Time Window
Label a Schedule
Batch scripts often run for a named time window. Modeling the label keeps schedule decisions visible without depending on the current clock.
Program
Play the script to choose the window and see the planned schedule label.
window_label_plan.sh
Replay: real traced execution (multi-file project)
#!/usr/bin/env bash
window="daily"
case "$window" in
daily) label="daily-00Z"; retention="7d" ;;
hourly) label="hourly-15"; retention="24h" ;;
esac
echo "$label retention=$retention"
#!/usr/bin/env bash
window="hourly"
case "$window" in
daily) label="daily-00Z"; retention="7d" ;;
hourly) label="hourly-15"; retention="24h" ;;
esac
echo "$label retention=$retention"
window ← daily
3window="daily"4case "$window" invalues this stepdailywindowcase "$window" in
3window="daily"4case "$window" in5 daily) label="daily-00Z"; retention="7d" ;;values this stepdailywindowlabel ← daily-00Z, retention ← 7d
4case "$window" in5 daily) label="daily-00Z"; retention="7d" ;;6 hourly) label="hourly-15"; retention="24h" ;;values this stepdaily-00Zlabel7dretentionecho "$label retention=$retention"
7esac8echo "$label retention=$retention"outputdaily-00Z retention=7dvalues this stepdaily-00Zlabel7dretention
window ← hourly
3window="hourly"4case "$window" invalues this stephourlywindowcase "$window" in
3window="hourly"4case "$window" in5 daily) label="daily-00Z"; retention="7d" ;;values this stephourlywindowlabel ← hourly-15, retention ← 24h
5 daily) label="daily-00Z"; retention="7d" ;;6 hourly) label="hourly-15"; retention="24h" ;;7esacvalues this stephourly-15label24hretentionecho "$label retention=$retention"
7esac8echo "$label retention=$retention"outputhourly-15 retention=24hvalues this stephourly-15label24hretention
time window
A time window names the period a batch job covers.
schedule label
Labels make scheduled output easier to group and inspect.
retention
Retention says how long outputs from that window should be kept.