Interview Prep/Shell Scripting/Troubleshooting: cron and systemd timers

The journal shows `Failed to parse calendar specification, ignoring: daily 02:00` and then `opskit-backup.timer: Timer unit lacks value setting. Refusing.`

IntermediateTroubleshootingTroubleshooting: cron and systemd timers
Answer

Likely causes → OnCalendar= takes either a shorthand (daily, weekly, hourly) or a full expression (DayOfWeek Year-Month-Day Hour:Minute:Second), not a mix. The only trigger was invalid, so the timer had no triggers and systemd refused to start it.

Diagnose →

systemd-analyze calendar 'daily 02:00'                  # error
systemd-analyze calendar '*-*-* 02:00:00' --iterations=3
systemd-analyze verify /etc/systemd/system/opskit-backup.timer

Fix →

[Timer]
OnCalendar=*-*-* 02:00:00
# or with a time zone (systemd 235+):  OnCalendar=*-*-* 02:00:00 Asia/Kolkata
RandomizedDelaySec=15min
Persistent=true

Prevent → Run systemd-analyze verify and systemd-analyze calendar on every unit in CI before it reaches a server.

All Shell Scripting questions Roadmap: Shell scripting (Bash)

More on Troubleshooting: cron and systemd timers