Cron expression for the 1st and 15th of the month

Runs the job on the first and the fifteenth of every month.

0 0 1,15 * *

Generator

At 12:00 AM, on days 1 and 15 of the month

Field by field

  • Minute · 0–59 0 only at minute 0
  • Hour · 0–23 0 only at 00:00
  • Day of month · 1–31 1,15 only on days 1 and 15
  • Month · 1–12 or JAN–DEC * every month
  • Day of week · 0–7 or SUN–SAT * every day of the week

Next runs in your local time

Why this schedule, and when it bites

Twice a month is a business calendar, not a mathematical one: payroll, invoicing and statements live on the 1st and the 15th. 0 0 1,15 * * writes those two days as a list in the day-of-month field, and that list is why the schedule works in every cron. The alternative people try, a step of fourteen days, produces a third run in long months.

A day step is not a fortnight. 0 0 */14 * * fires on the 1st, the 15th and the 29th in a 31-day month, because the step restarts every month. The extra run lands in the audit trail and, for payroll, in someone's inbox. List the days explicitly.

The 15th is not mid-month for February. In February the 15th is roughly the middle; in a 31-day month it is a day short. If the run splits a period in half, compute the split date in the job from the actual month length instead of hard-coding two dates.

Weekends belong to the calendar too. When the 15th falls on a Sunday, the payroll run still fires. Most finance processes want the previous business day; add a guard that shifts the run when the date lands on Saturday or Sunday, and document the rule where the schedule lives.

Where this cron expression shows up

  • Semi-monthly payroll and invoicing runs
  • Statements and reminders that go out twice a month
  • A mid-month progress report next to the month-end one

Common variations

  • The same days at 09:00 instead of midnight

    0 9 1,15 * * At 09:00 AM, on days 1 and 15 of the month

  • The first day of the month only

    0 0 1 * * At 12:00 AM, on day 1 of the month

  • The last day of the month instead

    0 0 L * * At 12:00 AM, on the last day of the month

It is not every two weeks. 0 0 */14 * * is the expression people reach for when they want that, and it fires on the 1st, the 15th and the 29th of a long month, which is the run that shows up in the audit.

Ranges, steps, and names are spelled out on the cheat sheet.

Questions this schedule raises

Does 0 0 1,15 * * mean every two weeks?

No. It means the 1st and the 15th of each month, twelve times a year with uneven gaps that run from fourteen to seventeen days depending on the month. True every-two-weeks schedules need a weekly expression plus a guard, or a scheduler with interval support.

How do I run at 9 AM on the 1st and 15th?

Replace the leading zeros with the hour: 0 9 1,15 * *. The job fires at 09:00 on both days in the daemon's timezone. If the run must survive a missed morning, add a catch-up check on the next boot.