How to schedule the quartz.net job that executes last working day every of two months

Hi Expert,

How to schedule the quartz.net job that executes last working day every of two months

Thanks,
JR
JRAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

MlandaTCommented:
Your cron expression would be :

0 0 15 LW 1/2 ?

The 15 is hours. So this cron will run in last weekday of every month at 3pm. I assume weekday=working day

The 1/2 is for month. Starting month 1, every 2 months.  

Test it here : http://www.cronmaker.com
0
JRAuthor Commented:
On the schedule holiday should be considered.
0
MlandaTCommented:
Then you are not looking for a cron expression. A cron expression cannot factor in other date lookups and such. You will have to find an alternative implementation.
0
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

MlandaTCommented:
You can manage things by having the job reschedule itself if it fires on a holiday.

So your cron trigger can still run as intended, BUT if your Job it picks up that it is a holiday... it can create a new once-off schedule for itself to run on the next business day or something... OR at the end of  run, you can check when the next scheduled run will be, see if it's a holiday. If it is a holiday, create a once-off schedule to run a day before... your cron-based job will still run as usual...

Something like that.
0
Éric MoreauSenior .Net ConsultantCommented:
"working day"

That just doesn't mean the same thing for every body! It depends on your country, and even sometime the state/province inside the country!

I really doubt that quartz.net has the notion of holiday.

There are a couple of ways around it:
-run your job everyday starting the 25 of every month and the first task of your job is to find out if it is the last working day.
-at the end of your job, find out the next date your job must run and schedule it.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
MlandaTCommented:
You can configure calendars in quartz.net via the ICalendar interface which comes with several default implementations... and it would then not fire of the holidays. But it would not do the rescheduling. It will just skip those days, which in your case, without the rescheduling, would result in quite a big gap.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.