All cron examples

Cron expression: last day of the month (workaround)

Standard cron has no 'last day' token — this fires on days 28-31 and the job itself must check it's really the last day.

0 0 28-31 * *

Field by field

FieldValueMeaning
Minute0At minute 0
Hour0At hour 00:00
Day of month28-31From 28 through 31
Month*Every month
Day of week*Every day of the week

Typical uses

  • Month-end closing jobs
  • End-of-month reports

Good to know

  • Pair the schedule with a guard such as: 0 0 28-31 * * [ "$(date +\%d -d tomorrow)" = "01" ] && /path/job.
  • Some cron implementations (Quartz, certain BSDs) support an L token for 'last day' — check yours before relying on it.

Need a different schedule? Build and validate any cron expression visually with the free Cron Expression Builder.