* means all possible values in the field. ? means you don't care about meaning. It is used when you have two fields that may conflict with each other. A common example is the fields of the month of the month and the day of the week. Consider, for example, the cron specification for working at 10am on the first day of each month:
0 0 10 1 * ? *
Now undo it:
- Seconds:
0 - we want it to work at 10:00: 00 - Minutes:
0 - we want it to work at 10: 00 : 00 - Hours:
10 - we want it to work at 10 : 00: 00 - Day of the month:
1 - we want it to start on the 1st of every month. - Month:
* - we want it to run every month (for example, January 1, February 1, etc.). - Day of the week
? - we don’t care about the day of the week. Cron should work on the 1st of every month, regardless of whether it is Sunday, Monday, etc. - Year:
* - we want it to run every year
source share