Cron expression for the last day of the month
0 0 28-31 * *At 00:00, on the 28th through 31st of the month.
Standard cron has no “last day” symbol. The portable trick is to schedule days 28–31 and let the command run only when tomorrow is the 1st: [ "$(date -d tomorrow +\%d)" = 01 ] && /path/to/job (GNU date). Quartz and AWS support L directly.
Try it and tweak it
Change any field below and the preview updates. Set the time zone to match your server.
At 00:00, on the 28th through 31st of the month.
Next 10 runs
Calculating in your browser…
Times are computed in your browser for the selected zone and are informational. The server that runs the job uses its own zone (often UTC) and cron flavour, so verify there.
Same schedule in other dialects
0 0 28-31 * *0 0 0 28-31 * ?0 0 0 28-31 * ?cron(0 0 28-31 * ? *)Add it to your crontab
- Open your crontab with
crontab -e. - Add one line:
0 0 28-31 * * /full/path/to/command >> /var/log/job.log 2>&1 - Save and exit. Cron reloads automatically; confirm with
crontab -l.
Need the output silenced, a lock against overlapping runs or a system crontab user column? The generator’s full crontab line builder writes it for you. Already have a crontab? Paste it into the crontab parser to check every job.
Variations
0 0 L * ? | Quartz / Spring: last day of the month |
cron(0 0 L * ? *) | AWS EventBridge |
In other schedulers
| crontab line | 0 0 28-31 * * /path/to/command |
| Quartz | 0 0 0 28-31 * ? |
| Spring | @Scheduled(cron = "0 0 0 28-31 * ?") |
| AWS EventBridge | cron(0 0 28-31 * ? *) |
| GitHub Actions | - cron: '0 0 28-31 * *' (UTC) |
| Kubernetes | schedule: "0 0 28-31 * *" |