Common causes
Both fields set
The explainer says it: on the 1st of the month, or on Monday. Every Monday and the 1st both run.
Input
0 9 1 * 1
Cron Explainer says
At 09:00, on the 1st of the month, or on Monday
Only one of them set
With a star in the other field, there is nothing to combine and the line means exactly what it says.
Input
0 9 * * 1
Cron Explainer says
At 09:00, on Monday
A range of days plus a weekday
1-7 is the first week of the month. Hoping for the first Monday, you get the first seven days and every Monday.
Input
0 9 1-7 * 1
Cron Explainer says
At 09:00, on the 1st, 2nd, 3rd, 4th, 5th, 6th and 7th of the month, or on Monday
A day that is not every month
Day 31 never runs in a month with 30 days. February 30 never runs at all.
Input
0 0 31 2 *
Cron Explainer says
At 00:00, on the 31st of the month, in February
How to fix it
- Set only one of the two fields and put the other condition in the command, for the first Monday: 0 9 * * 1 [ "$(date +\%d)" -le 7 ] && your-job.
- In crontab, write each percent sign as \% or it is read as a line break.
- Use a scheduler that combines them, such as a systemd timer with OnCalendar=Mon *-*-1..7 09:00.
- Paste the line into the cron explainer: the next run times show the days that really match.