Schedule a job for working day of the month
Schedule a job for working day of the month
I want to schedule a job to run every 16th of the month, but if it is Saturday or Sunday then it should run on Monday. Can somebody help me to do it without defining a new calendar.
- th_alejandro
- Nouveau
- Posts: 188
- Joined: 26 Nov 2008 12:00
- Location: Bogotá
Without calendar
It's more efficient using a Calendar in this case.
But other ideas :
- Create a script that depends of 'dates' to run this job in a text file. Ex:
01-16-2013
02-18-2013 (02-16-2013 is saturday)
03-18-2013 (03-16-2013 is saturday)
04-16-2013
05-16-2013
06-17-2012 (06-16-2013 is sunday)
..
...
Then, create a function in the script. that evaluate current date vs dates in the text file. So, if this dates are equal, run the job.
Your process must run every day, but the initial script check for date and determine if the job really run or not on that date.
But other ideas :
- Create a script that depends of 'dates' to run this job in a text file. Ex:
01-16-2013
02-18-2013 (02-16-2013 is saturday)
03-18-2013 (03-16-2013 is saturday)
04-16-2013
05-16-2013
06-17-2012 (06-16-2013 is sunday)
..
...
Then, create a function in the script. that evaluate current date vs dates in the text file. So, if this dates are equal, run the job.
Your process must run every day, but the initial script check for date and determine if the job really run or not on that date.