'Autosys job scheduled to run except last 4 days of every month
I was looking into scheduling an autosys job which runs on all workdays, but except last 4 days of every month. I use the autocal_asc command and do not use GUI.
I tried to set up the 3 calendars with MNTHD#L with adjust = 0; MNTHD#L with adjust = -1 and MNTHD#L with adjust = -2 for example. Wanted to include this as exclude_calendar option in my job definition. But exclude_calendar does not accept multiple calendars.
How can I achieve this ?
Thanks in advance.
Solution 1:[1]
This has been resolved. You can use Standard Calendar instead of an Extended calendar. Import the specific dates from a file into Calendar - The dates on which the job should not run. In this case - last 4 days of every month. And then you can use exclude calendar feature.
Let's say we have this file - last4daysOfMonth -
calendar:last_4_days_of_month
01/28/2015
01/29/2015
01/30/2015
01/31/2015
.
.
12/31/2015
You can create a Standard calendar by importing these dates using this autosys command -
autocal_asc -I last4daysOfMonth
And in the job, you can specify this calendar as exclude calendar.
date_conditions:1
exclude_calendar:last_4_days_of_month
days_of_week:mo,tu,we,th,fr
start_times: 02:00
This will run the job on all weekdays except last 4 days of every month.
Solution 2:[2]
Anotherway is to create an extended calendar with condition as
MNTHDM1|MNTHDM2|MNTHDM3|MNTHDM4
this considers last 4 days of all months.
Add this calendar to
exclude_calendar
attribute for your jobs.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | user571807 |
Solution 2 | Piyush |