HubTools

Cron Monthly Generator

Pre-loaded with 0 0 1 * * — fires on the 1st of every month at midnight.

How do you write a monthly cron expression?

0 0 1 * * fires once a month, at midnight on the 1st — the canonical 'monthly' cron expression and the equivalent of `@monthly`. The third field (day of month) is set to 1, while month (4th field) and day-of-week (5th field) stay as wildcards. Monthly jobs are common for: invoicing and billing rollups, archiving last month's data, generating monthly reports, rotating long-lived credentials, or aging out old records. Change the `1` to any day 1–28 for safety; days 29–31 don't exist in every month.
Minute0-59, * for every, */5 for every 5 minutes
Hour0-23, * for every, */2 for every 2 hours
Day of Month1-31, * for every, 1,15 for specific days
Month1-12, * for every, 1-6 for Jan through Jun
Day of Week0-6 (0=Sunday), * for every, 1-5 for weekdays
Generated Expression

0 0 1 * *

At minute 0 past hour 0 on day 1 of the month
Next 5 Runs:
6/1/2026, 12:00:00 AM7/1/2026, 12:00:00 AM8/1/2026, 12:00:00 AM9/1/2026, 12:00:00 AM10/1/2026, 12:00:00 AM
Cron Reference
FieldRangeSpecialExample
Minute0-59* , - /*/5 = every 5 min
Hour0-23* , - /9-17 = 9 AM to 5 PM
Day of Month1-31* , - /1,15 = 1st and 15th
Month1-12* , - /1-6 = Jan to Jun
Day of Week0-6* , - /1-5 = Mon to Fri
Special Characters
* Any value
, Value list separator
- Range of values
/ Step values
Day of Week Values
0=Sun1=Mon2=Tue3=Wed4=Thu5=Fri6=Sat

About the monthly cron pattern

0 0 1 * * fires once a month at midnight on the 1st in the daemon's local time zone.
  • Field positions: minute hour day-of-month month day-of-week
  • Day of month is the 3rd field — valid range 1–31 (no 'last day' shortcut)
  • Equivalent shortcut: @monthly (Vixie cron extension, not in AWS/Kubernetes)
  • Setting both day-of-month AND day-of-week is OR semantics on Vixie cron — not AND

Frequently asked questions

What's the day-of-month vs day-of-week trap?
When BOTH the day-of-month (3rd) and day-of-week (5th) fields are set (not *), Vixie cron uses OR logic, not AND — the job fires when EITHER condition matches. So `0 0 15 * 1` fires on the 15th of every month AND every Monday, not 'the 15th IF it's a Monday'. To require both, you have to wrap a runtime check inside the job. Quartz cron (Java) uses different semantics — it requires you to set one field to `?` to disambiguate. Always test schedules with mixed fields.