Please , take a look if this Solution Approach attend:
Since AutoSys does not natively support mixing absolute dates (1st and 15th) with workdays in a single calendar, we need to break this into two parts:
- Identify the two workdays before the 1st of each month.
- Identify the two workdays before the 15th of each month.
- Combine these conditions into a single calendar.
Step-by-Step Configuration
1. Create a Base Workday Calendar
This calendar should exclude weekends and company holidays:
- Run the command:
autocal_asc
- Define a workday-based calendar (e.g.,
WORKDAYS_CAL
) that marks only business days.
2. Create a Calendar for "Two Workdays Before the 1st"
-
First, create a calendar marking the 1st of each month:
autocal_asc
- Create a new calendar:
FIRST_DAY
- Manually mark the 1st day of each month.
-
Next, define a relative workday rule:
autocal_asc
- Create a new custom calendar:
TWO_DAYS_BEFORE_1ST
- Use the rule: "2 workdays before FIRST_DAY"
- This will calculate the two previous workdays, skipping weekends/holidays.
3. Create a Calendar for "Two Workdays Before the 15th"
-
First, create a calendar marking the 15th of each month:
autocal_asc
- Create a new calendar:
FIFTEENTH_DAY
- Manually mark the 15th day of each month.
-
Then, define a relative workday rule:
autocal_asc
- Create a new calendar:
TWO_DAYS_BEFORE_15TH
- Use the rule: "2 workdays before FIFTEENTH_DAY"
4. Combine Both Calendars
Once you have TWO_DAYS_BEFORE_1ST
and TWO_DAYS_BEFORE_15TH
, you can create a final calendar that merges both:
autocal_asc
5. Assign the Calendar to a Job
Now, when scheduling your job, assign it to FINAL_CALENDAR
in the JIL definition:
insert_job: my_job
job_type: CMD
calendar: FINAL_CALENDAR
command: /path/to/script.sh
Verification
To check if the dates are correct:
autocal_asc -x FINAL_CALENDAR -Y 2025
This will show all execution dates for the calendar in 2025.
Conclusion
By separating the rules into multiple calendars and then combining them, you can effectively schedule jobs two workdays before the 1st and 15th of the month, avoiding weekends and holidays.