08-02-2023, 07:04 AM
I have the following cron expression in my system:
0 0 0/1 1/1 * ? *
and you know what? I have no idea what it means. The guy who has written it is on his holiday for the next 2 weeks so I have to find out on myself. The documentation can be found [here][1]
According to the [documentation][1] we have:
* * * * * * *
| | | | | | |
| | | | | | +-- Year (range: 1970-2099)
| | | | | +---- Day of the Week (range: 1-7 or SUN-SAT)
| | | | +------ Month of the Year (range: 0-11 or JAN-DEC)
| | | +-------- Day of the Month (range: 1-31)
| | +---------- Hour (range: 0-23)
| +------------ Minute (range: 0-59)
+-------------- Second (range: 0-59)
Ok, let me tell you what I think: I believe that the expression means:
start when:
seconds: 0
minutes: 0
hours: 0
dayOfMonth 1
monthOfYear any
dayOfWeek any
year any
run every:
1 hour
1 dayOfWeek
when:
dayOfWeek same as on first execution
However available cron expression monitors says that it simply means every hour.
As the one who has written that is Senior Java Dev, he must have known any reason for writing such expression instead of:
0 0 * * * * *
We use `org.springframework.scheduling.quartz.QuartzJobBean`.
**Short summary**
Well, I think that my question is: what is the difference between `0 0 0/1 1/1 * ? *` and `0 0 * * * * *`?
**Edit:**
[The documentation][2] can be found here.
[1]:
0 0 0/1 1/1 * ? *
and you know what? I have no idea what it means. The guy who has written it is on his holiday for the next 2 weeks so I have to find out on myself. The documentation can be found [here][1]
According to the [documentation][1] we have:
* * * * * * *
| | | | | | |
| | | | | | +-- Year (range: 1970-2099)
| | | | | +---- Day of the Week (range: 1-7 or SUN-SAT)
| | | | +------ Month of the Year (range: 0-11 or JAN-DEC)
| | | +-------- Day of the Month (range: 1-31)
| | +---------- Hour (range: 0-23)
| +------------ Minute (range: 0-59)
+-------------- Second (range: 0-59)
Ok, let me tell you what I think: I believe that the expression means:
start when:
seconds: 0
minutes: 0
hours: 0
dayOfMonth 1
monthOfYear any
dayOfWeek any
year any
run every:
1 hour
1 dayOfWeek
when:
dayOfWeek same as on first execution
However available cron expression monitors says that it simply means every hour.
As the one who has written that is Senior Java Dev, he must have known any reason for writing such expression instead of:
0 0 * * * * *
We use `org.springframework.scheduling.quartz.QuartzJobBean`.
**Short summary**
Well, I think that my question is: what is the difference between `0 0 0/1 1/1 * ? *` and `0 0 * * * * *`?
**Edit:**
[The documentation][2] can be found here.
[1]:
[To see links please register here]
[2]:[To see links please register here]