Field-by-field breakdown
| Field | Value | Meaning |
|---|---|---|
| Minute | 55 | 55 |
| Hour | 23 | 23 |
| Day of month | 28-31 | 28 through 31 |
| Month | * | Every month |
| Day of week | * | Every day of the week |
Copy-paste examples
Linux crontab
# crontab -e
# runs on days 28-31, but the command only fires when tomorrow is the 1st
55 23 28-31 * * [ "$(date -d tomorrow +\%d)" = "01" ] && /usr/local/bin/my-job.sh >> /var/log/my-job.log 2>&1
Kubernetes CronJob
apiVersion: batch/v1
kind: CronJob
metadata:
name: my-job
spec:
schedule: "55 23 28-31 * *"
concurrencyPolicy: Forbid
jobTemplate:
spec:
template:
spec:
restartPolicy: OnFailure
containers:
- name: my-job
image: busybox:1.36
command: ["sh", "-c", "date; echo Hello from cron"]
GitHub Actions
on:
schedule:
- cron: '55 23 28-31 * *' # always UTC
GitHub Actions evaluates schedules in UTC, does not accept macros such as @daily, and will not run workflows more often than every 5 minutes; runs can also be delayed during periods of high load.
Common variations
Click an expression to load it into the tool above.
| Cron expression | Schedule |
|---|---|
| At 10:00 PM, between day 28 and 31 of the month. | |
| At 12:05 AM, on day 1 of the month. | |
| At 11:55 PM, between day 28 and 31 of the month, only in March, June, September, and December. | |
| At 12:00 AM, between day 28 and 31 of the month. |
Frequently asked questions
What does 55 23 28-31 * * mean in cron?
At 11:55 PM, between day 28 and 31 of the month. The five fields are minute 55, hour 23, day of month 28-31, month * and day of week *.
How do I run a cron job the last day of every month in Linux?
Run crontab -e, add the lines from the Linux crontab example on this page, then save and exit. Use absolute paths, redirect output to a log file, and confirm it runs with grep CRON /var/log/syslog.
When will 55 23 28-31 * * run next?
It depends on the current time and the time zone of the machine running cron. The calculator on this page shows the next 5 run times in your local time zone; on a server, cron uses the system time zone, which is often UTC.
How do I run a job on the last day of the month in Kubernetes or GitHub Actions?
Both accept only standard cron syntax, so schedule the job on days 28-31 and make its first step the same check: [ "$(date -d tomorrow +%d)" = "01" ] || exit 0. Inside a script or YAML file % needs no escaping, and on macOS or BSD use date -v+1d +%d instead. Scheduled GitHub Actions runs can start late, and a 23:55 run that begins after midnight fails the check, so pick an earlier time there, such as 0 22 28-31 * *.