Tools › Cron examples › the first day of every month
Cron expression for the first day of every month
The cron expression for the first day of every month is:
What it does
Runs at 00:00 on the 1st of each month. @monthly is a shortcut for the same schedule.
Field by field
| Field | Value | Meaning |
|---|---|---|
| Minute | 0 | exactly 0 |
| Hour | 0 | exactly 0 |
| Day of month | 1 | exactly 1 |
| Month | * | every value |
| Day of week | * | every value |
Typical uses
Monthly invoices, usage resets, and monthly reports.
Watch out for
Day 31 does not exist in every month, so 'last day of the month' needs a different approach (see the last-day-of-month example).
Add it to your crontab
crontab -e, then add:
0 0 1 * * /path/to/command >> /var/log/myjob.log 2>&1