Interview Prep/Shell Scripting/cron and systemd timers

How do you validate a calendar expression and test a timer without waiting?

IntermediateConceptcron and systemd timers
Answer
systemd-analyze calendar 'Mon..Fri *-*-* 09:00:00'     # normalized form and next elapse
systemd-analyze calendar --iterations=5 '*:0/15'
systemd-analyze verify /etc/systemd/system/backup.{service,timer}
systemctl start backup.service                          # run now
journalctl -u backup.service -n 50 --no-pager           # see output
systemctl list-timers --all

systemd-analyze calendar catches typos like *-*-* 2:30 vs 02:30 interpretation, and shows the timezone used.

All Shell Scripting questions Roadmap: Shell scripting (Bash)

More on cron and systemd timers