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
| Field | Value | Meaning |
|---|---|---|
| Minute | 0 | At minute 0 |
| Hour | 0 | At hour 00:00 |
| Day of month | 28-31 | From 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
Ltoken for 'last day' — check yours before relying on it.
Related schedules
Need a different schedule? Build and validate any cron expression visually with the free Cron Expression Builder.