Cron expression for the first day of the month
0 0 1 * *What it does
The expression 0 0 1 * * runs a job at 00:00 on the 1st of every month. Minute and hour are 0, the day-of-month field is 1, and month and day-of-week are *. It fires twelve times a year, at the start of each month.
First-of-month is the natural home for monthly work: invoices, statements, usage resets, and month-boundary reports. Running at midnight on the 1st means the previous month is fully closed before the job starts.
It is equivalent to @monthly. Keep the day-of-week field as *: if you restrict it as well — say 0 0 1 * 1 hoping for "the first Monday" — cron will run on the 1st and every Monday, because it takes the union of the two day fields. "First Monday of the month" cannot be expressed in a single standard cron line; restrict the date and check the weekday inside your script.
Related presets
FAQ
@monthly expands to 0 0 1 * * — midnight on the 1st of every month.0 0 1-7 * * to fire on the first week, then exit early in your script unless it is Monday.L; otherwise run daily and exit unless tomorrow is the 1st.