Home › DevOps › AutoSys: Run a Job on the First Tuesday (or Last Friday) of the Month with an Extended Calendar
Intermediate 3 min · November 09, 2026

AutoSys: Run a Job on the First Tuesday (or Last Friday) of the Month with an Extended Calendar

days_of_week can't say 'first Tuesday': it runs every Tuesday.

N
Naren Founder & Principal Engineer

20+ years shipping production infrastructure and CI/CD at scale. Written from production experience, not tutorials.

Follow
✓ Production
production tested
November 09, 2026
last updated
2,128
articles · all by Naren
Before you start⏱ 6 min
  • ✓AutoSys JIL basics
 ● Production Incident 🔎 Debug Guide
⚡Quick Answer
  • days_of_week: tu runs EVERY Tuesday. It can't express first or last.
  • Use an extended calendar with a date condition: TUE#1 = first Tuesday, FRI#L = last Friday.
  • Combine with & (and) and | (or): (JAN&TUE#1)|(JUL&TUE#1) = first Tuesday of January and July (half-yearly).
  • Attach a holiday calendar and set the holiday action (skip, or move to a workday).
  • Create it with autocal_asc or in the web UI, then set run_calendar on the job with date_conditions: 1.
  • Check the generated dates before relying on it.
✦ Definition~90s read
What is AutoSys?

An AutoSys extended calendar is a calendar defined by a rule instead of a list of dates. Date condition keywords such as TUE#1 (first Tuesday of the month) and FRI#L (last Friday) generate the run dates, and a holiday calendar plus a holiday action decides what happens when a rule lands on a holiday. A job uses it through run_calendar.

★
days_of_week is a standing order: "every Tuesday".
Plain-English First

days_of_week is a standing order: "every Tuesday". An extended calendar is a rule: "the first Tuesday of each month, but not on a bank holiday". AutoSys works out the dates for you.

A month-end close that should run on the first Tuesday ran five times in December, because days_of_week: tu means every Tuesday. AutoSys extended calendars handle first, last and nth-weekday rules, and holidays. This guide shows the rules and how to attach one to a job.

Why days_of_week Isn't Enough

days_of_week: tu selects every Tuesday. Months have four or five, so a 'monthly' job defined this way runs four or five times.

wrong.jilJIL
1
2
3
4
update_job: MONTH_CLOSE
date_conditions: 1
days_of_week: tu
start_times: "06:00"   # every Tuesday
🎯 Key Takeaway
days_of_week = every matching weekday.

Extended Calendar Rules

Date condition keywords pair a weekday with an ordinal. #1 is the first, #L is the last. Combine terms with & and |, and with month names to limit the months.

rules.txtTEXT
1
2
3
TUE#1                     first Tuesday of every month
FRI#L                     last Friday of every month
(JAN&TUE#1)|(JUL&TUE#1)   first Tuesday of January and July
🔥Check your version
Keywords and options vary slightly by AutoSys version; check the date condition keywords page for yours.
🎯 Key Takeaway
TUE#1, FRI#L, (JAN&TUE#1)|(JUL&TUE#1).

Holidays

A rule can land on a holiday: the last Friday of December 2026 is the 25th. Attach a holiday calendar and set the holiday action to skip the run or move it to a workday.

calendar.txtTEXT
1
2
3
4
extended_calendar: LAST_FRI
workday: mo,tu,we,th,fr
condition: FRI#L
holcal: US_HOLIDAYS
🎯 Key Takeaway
Add holidays so rules don't land on days off.

Use It in a Job

Create the calendar with autocal_asc or the web UI, then point the job at it with run_calendar and date_conditions: 1. Remove days_of_week.

job.jilJIL
1
2
3
4
update_job: MONTH_CLOSE
date_conditions: 1
run_calendar: FIRST_TUE
start_times: "06:00"
🎯 Key Takeaway
run_calendar replaces days_of_week.
● Production incidentPOST-MORTEMseverity: high

The Close That Ran Five Times

Symptom
Finance saw five close runs in December: the 1st, 8th, 15th, 22nd and 29th.
Assumption
The author thought days_of_week: tu plus a monthly intent would run once.
Root cause
days_of_week only lists weekdays; it has no idea of first or last. December 2026 has five Tuesdays.
Fix
Created an extended calendar FIRST_TUE with condition TUE#1, set run_calendar: FIRST_TUE and removed days_of_week.
Key lesson
  • days_of_week means every matching day.
  • Use an extended calendar for first/last/nth rules.
  • Attach a holiday calendar.
Production debug guideWhy did it run, or not?3 entries
Symptom · 01
Runs too often
→
Fix
The job still has days_of_week, or the calendar rule is broader than meant. Check autorep -J JOB -q.
Symptom · 02
Didn't run on the expected day
→
Fix
The date may be a holiday or non-workday; check the holiday calendar and holiday action.
Symptom · 03
Not sure what dates it will produce
→
Fix
Review the calendar's generated dates in the web UI or autocal_asc before the period starts.
⚙ Quick Reference
4 commands from this guide
FileCommand / CodePurpose
wrong.jilupdate_job: MONTH_CLOSEWhy days_of_week Isn't Enough
rules.txtTUE#1 first Tuesday of every monthExtended Calendar Rules
calendar.txtextended_calendar: LAST_FRIHolidays
job.jilupdate_job: MONTH_CLOSEUse It in a Job

Key takeaways

1
days_of_week can't say first or last.
2
TUE#1 = first Tuesday, FRI#L = last Friday.
3
Combine with & and |.
4
Attach a holiday calendar.
5
Use run_calendar on the job.

Common mistakes to avoid

2 patterns
×

days_of_week for monthly jobs

Symptom
Runs 4-5 times a month.
Fix
Extended calendar with TUE#1.
×

No holiday calendar

Symptom
Runs on a public holiday.
Fix
Attach holcal and set the holiday action.
INTERVIEW PREP · PRACTICE MODE

Interview Questions on This Topic

Q01SENIOR
How do you schedule an AutoSys job on the first Tuesday of each month?
Q01 of 01SENIOR

How do you schedule an AutoSys job on the first Tuesday of each month?

ANSWER
Create an extended calendar with condition TUE#1 and set run_calendar on the job.
FAQ · 3 QUESTIONS

Frequently Asked Questions

01
How do I set an AutoSys job to run on the first Tuesday of every month?
02
How do I give half-yearly date conditions?
03
days_of_week versus calendar?
COMPLETE GUIDE
The Complete AutoSys Workload Automation Guide for Engineers →

JIL syntax, sendevent, autorep, box jobs, file watchers, scheduling, HA, security, cloud workload automation, and 22 interview questions — the definitive AutoSys reference for production engineers.

N
Naren Founder & Principal Engineer

20+ years shipping production infrastructure and CI/CD at scale. Written from production experience, not tutorials.

Follow
✓ Verified
production tested
November 09, 2026
last updated
2,128
articles · all by Naren
🔥

That's AutoSys. Mark it forged?

3 min read · try the examples if you haven't

←
Previous
Deploying AutoSys JIL to Production Safely
45 / 49 · AutoSys
Next
AutoSys Resources: One Job at a Time
→