r/SpringBoot•
Mykoliux-1

How to indicate cron job correctly in Spring Scheduler if I want the job to launch once a month at specific hour ? Why some examples use `?` instead of `*` for day of the week field ?

Hello. I want my Spring Boot scheduler to launch at specific day of the month and at specific hour. In this particular case I want it to launch at 26th of the month at 2 o'clock at night.

Is the cron job like this correct '0 0 2 26 * ?' . Is the question mark symbol allowed to be used at the end for day of the week ?

Documentation tells "For the day-of-the-month or day-of-the-week fields, a question mark (?) may be used instead of an asterisk." , but why would they allow different symbol instead of just asterisk ?

Posted Jul 24, 2024, 8:53 PM UTC

21
Loading comments…