Hi All,
I am using spring task scheduler to execute couple of task at particular time (like every day at 3:00 AM, every Monday at 10:00PM etc). For one of task I have specific requirement to execute it first Monday of every month at 3:00 AM. I search some forums and tried below expression but none of them work,
or
Above expression throws as below,
I have read the documentation of Spring but it does not mention about MON#1 format but some forums does.
I have also review the Spring source (for CronSequenceGenerator) but could not find any code to handle this expression (which interpret as First Monday of every month).
Hi Manish,
Thanks for the reply. I figure it out using "0 1 0 1-7 * MON" expression (which ensure it only run for 1st 7 days of month - first week of month). But definitely I will try your expression as well.
Apologies the String should be It will make it run only once in a month. This works in cron job, not sure it works in spring task or not. you need to test it to confirm it.
Thanks,
Manish S.
Think of how stupid the average person is. And how half of them are stupider than that. But who reads this tiny ad?
a bit of art, as a gift, that will fit in a stocking