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

Hi Expert,

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

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

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.

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 :
JRAuthor Commented:
On the schedule holiday should be considered.
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.
Exploring SharePoint 2016

Explore SharePoint 2016, the web-based, collaborative platform that integrates with Microsoft Office to provide intranets, secure document management, and collaboration so you can develop your online and offline capabilities.

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.
É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 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.

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
You can configure calendars in 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.
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.