The crontab(5) manual says:
Commands are executed by cron(8) when the minute, hour, and month of year fields match the current time, and when at least one of the two day fields (day of month, or day of week) match the current time (see ``Note'' below). cron(8) examines cron entries once every minute. The time and date fields are:
field allowed values ----- -------------- minute 0-59 hour 0-23 day of month 1-31 month 1-12 (or names, see below) day of week 0-7 (0 or 7 is Sun, or use names)
It also says:
A field may be an asterisk (*), which always stands for ``first-last''.
And in examples there is:
@weekly Run once a week, "0 0 * * 0". From asterisk description, "0 0 * * 0" is the same as "0 0 1-31 1-12 0". My question is why doesn't every day match this expression? Documentation says
when the minute, hour, and month of year fields match the current time, and when at least one of the two day fields (day of month, or day of week) match the current time
So why aren't both 2019.12.25 00:00 and 2019.12.26 00:00 valid moments for this expression?
Both of them satisfy the "minute, hour, and month of year fields match the current time", as month is 1-12 and minute and hour are 0.
And also both of them will satisfy the "at least one of the two day fields (day of month, or day of week) match the current time" - as the day of the month is 1-31 and one satisfaction is enough.
Where am I wrong?
Note: The day of a command's execution can be specified by two fields - day of month, and day of week. If both fields are restricted (ie, aren't *), the command will be run when either field matches the current time. For example, "30 4 1,15 * 5" would cause a command to be run at 4:30 am on the 1st and 15th of each month, plus every Friday.Doesn't this mean that "0 0 1,15 * 1-7" will include every day of month, meaning that writing * and writing 1-7 lead to different expressions?