Cron twice a month
The cron expression for twice a month is 0 0 1,15 * *. In words: at 00:00, on day 1 and 15 of the month.
What each field means
| Field | Value | Meaning |
|---|---|---|
| Minute | 0 | minute 0 |
| Hour | 0 | midnight |
| Day of month | 1,15 | day 1 and day 15 |
| Month | * | every month |
| Day of week | * | any day of the week |
Times are in the timezone of whatever runs the schedule: the server's local time for crontab, UTC for GitHub Actions.
Use it
In a crontab, with a FlatLyne ping after the job succeeds:
0 0 1,15 * * /usr/local/bin/job.sh && curl -fsS -m 10 --retry 5 https://api.flatlyne.com/<ping-token>
In a Kubernetes CronJob:
apiVersion: batch/v1 kind: CronJob spec: schedule: "0 0 1,15 * *" timeZone: "Etc/UTC"
In a GitHub Actions workflow (always UTC):
on:
schedule:
- cron: "0 0 1,15 * *"Know when it doesn't run
Cron doesn't tell you when a job fails or never starts. Create a FlatLyne check with the schedule 0 0 1,15 * *, add the curl above to your job, and get an email, Slack message or PagerDuty incident when a ping is late. See how to monitor a cron job.
Related schedules
- Cron every month 0 0 1 * *
- Cron every month on the 15th 0 0 15 * *
- Cron every quarter 0 0 1 */3 *
- Cron every 6 months 0 0 1 */6 *
- Cron every year 0 0 1 1 *
Have a different expression? Paste it into the cron expression tool, or browse all examples.