JIL Attributes Complete Reference — Every Key AutoSys Job Attribute
- Always set std_out_file and std_err_file on every CMD job — they are your primary debugging tools
- date_conditions: 1 must be set for start_times to take effect — without it, time-based scheduling is disabled
- n_retrys: 3 means 3 retries after initial failure — the job runs up to 4 times total
- JIL attributes define identity, schedule, dependencies, error handling, output, and resource control
- Common trap: date_conditions defaults to 0 — start_times are ignored without it
- n_retrys is retries after initial failure; total attempts = n_retrys + 1
- Always set std_err_file — without it, error output vanishes into /dev/null
- box_terminator kills the parent box on failure — use only for critical kill switches
AutoSys Quick Debug Cheat Sheet
Job is in ACTIVATED but should have started
autorep -j JOBNAME -qsendevent -E FORCE_START -J JOBNAMEJob fails with exit code 1, no log
autorep -q -j JOBNAME | grep std_errcat /logs/autosys/JOBNAME.err (if exists)Job runs infinitely, no term_run_time set
sendevent -E KILLJOB -J JOBNAMEautorep -j JOBNAME -w 20 (wait 20 secs for status)Job reports success but downstream jobs don't start
autorep -j DOWNSTREAM_JOB -q | grep conditionautorep -j JOBNAME -w 0 (check exit code)Production Incident
Production Debug GuideSymptom → Action
A JIL job definition can contain dozens of attribute statements, each controlling a different aspect of how the job behaves. You don't need to memorise all of them, but you do need to know the commonly used ones by heart and know where to find the rest.
This article covers every attribute you'll encounter in production AutoSys environments, grouped by what they control. Each attribute includes its purpose, valid values, and a note on when it matters.
Identity attributes
These attributes define the basic identity of the job. They are the first things AutoSys reads when processing a job definition. Without a name, type, owner, and machine, the job cannot exist. The permission attribute controls visibility and who can modify or run the job — a practical concern in shared environments where multiple teams manage the same scheduler.
insert_job: my_job_name /* unique name in this AutoSys instance */ job_type: CMD /* CMD, BOX, or FW */ description: "What this job does" /* free text, shows in WCC */ owner: batchuser /* OS user the command runs as */ machine: prod-server-01 /* agent machine where job executes */ permission: gx,ge,wx,we,mx,me /* who can view/edit/run this job */
Scheduling attributes
These attributes control when the job runs. The most common mistake is forgetting date_conditions: 1 — without it, start_times, days_of_week, run_calendar are all ignored. The run_window attribute restricts when the job may run (useful for overnight batch windows). Timezone is often overlooked but critical when your agents are in different timezones than your control server.
/* Enable time-based scheduling (must be 1 for start_times to apply) */ date_conditions: 1 /* Days of week: all, mon-fri, or specific days like mon,wed,fri */ days_of_week: mon-fri /* Time(s) to start — multiple times separated by comma */ start_times: "02:00
Dependency and condition attributes
These attributes define what must be true before this job can start. Conditions use built-in functions: success(job), failure(job), done(job), notrunning(job). Multiple conditions can be combined with AND and OR. The box_name attribute links the job to a parent box — the box must be RUNNING for the job to start. Job_load and max_run_alarm provide load and runtime monitoring.
/* Start condition — use success(), failure(), done(), notrunning() */ condition: success(upstream_job) /* Multiple conditions — AND is implied between them */ condition: success(job_a) AND success(job_b) /* OR condition */ condition: success(job_a) OR success(job_b) /* Box membership */ box_name: parent_box_name /* links this job into a box */ /* Priority — higher number = higher priority when resources are constrained */ job_load: 10 /* how much machine capacity this job uses */ max_run_alarm: 60 /* alert if running longer than 60 minutes */ min_run_alarm: 5 /* alert if completed faster than 5 minutes */
done() when you want to proceed regardless of outcome.Output and logging attributes
Always set these. Debugging any AutoSys job failure without log files is extremely painful. The std_out_file captures standard output, and std_err_file captures standard error. If std_err_file is not set, error messages are lost. Use the > prefix to append instead of overwrite. You can also redirect to syslog using the \$AUTOUSER variable.
/* Standard output file path */ std_out_file: /logs/autosys/my_job.out /* Standard error file path */ std_err_file: /logs/autosys/my_job.err /* Append to existing log instead of overwrite */ std_out_file: >/logs/autosys/my_job.out /* > prefix means append */ /* Send output to syslog */ std_out_file: \$AUTOUSER/out/syslog.txt
Failure handling and retry attributes
These attributes control what happens when a job doesn't succeed on its first attempt. The n_retrys attribute is often misunderstood — it's the number of retries after the initial failure, so a job with n_retrys: 3 runs up to 4 times total. term_run_time is your safety net against hung jobs; without it, a stuck job can block an entire chain indefinitely. alarm_if_fail sends a WCC alert on final failure. box_terminator and job_terminator let you cascade failures.
/* Number of automatic retries before declaring FAILURE */ n_retrys: 3 /* Raise an alarm if job fails */ alarm_if_fail: 1 /* Maximum runtime in minutes before AutoSys terminates the job */ term_run_time: 90 /* Mark this job as a 'box terminator' — if it fails, fail the whole box */ box_terminator: 1 /* Mark this job as a 'job terminator' — if it fails, the job itself terminates */ job_terminator: 1 /* Send notification email on failure */ notification: mail notification_emailaddress: oncall-team@company.com notification_msg: "Job %s failed on machine %m at %t"
Job lifecycle attributes: insert_job, update_job, delete_job
This isn't a JIL attribute but a JIL command that defines how jobs are created and modified. insert_job creates a new job; using the same job name again with insert_job updates the existing job (not an error). update_job changes attributes on an existing job without affecting the schedule. delete_job removes the job definition. One-time overrides can be applied with job_name.start_times etc. in a separate JIL file.
/* Insert a new job (or update if exists) */ insert_job: daily_backup job_type: CMD command: /scripts/backup.sh machine: prod-db-01 owner: dbadmin /* Update an existing job's machine */ update_job: daily_backup machine: prod-db-02 /* Delete a job */ delete_job: daily_backup /* One-time override for a specific run */ daily_backup.start_times: "03:00"
- The same job can be inserted multiple times; each call adds or updates attributes.
- delete_job removes the job entirely — there is no undo.
- One-time overrides are temporary and reset after the job runs.
- Always use update_job for changes; re-inserting is for adding new jobs.
Calendars and global variables
AutoSys allows the use of named calendars to define complex schedules. A calendar is a JIL object that defines a set of dates (e.g., month-end, holidays). Jobs can reference calendars via run_calendar and exclude_calendar attributes. Global variables are defined using \$VAR syntax and can be shared across jobs. They are resolved at runtime by the agent.
/* Calendar definition */ insert_calendar: eom_calendar description: "End of month business days" weekdays: mon-fri condition: day_of_week = MON,TUE,WED,THU,FRI AND day_of_month = LAST /* Job referencing calendar */ insert_job: month_end_report job_type: CMD command: /scripts/report.sh machine: prod-app-01 run_calendar: eom_calendar exclude_calendar: holidays start_times: "23:00" /* Using global variable in command */ command: /scripts/process.sh \$HOME dir://data
| Attribute | What it controls | Required? | Default if omitted |
|---|---|---|---|
| job_type | CMD, BOX, or FW | Yes | None — must specify |
| machine | Which agent runs the job | Yes (CMD/FW) | None |
| owner | OS user to run as | Yes | None |
| date_conditions | Enable time-based scheduling | No | 0 (disabled) |
| start_times | When to start | If date_conditions=1 | None |
| condition | Dependency on other jobs | No | None (no dependency) |
| n_retrys | Automatic retry count | No | 0 (no retries) |
| alarm_if_fail | Alert on failure | No | 0 (no alert) |
| term_run_time | Kill after N minutes | No | None (no limit) |
| std_out_file | Stdout log path | No | None (stdout discarded) |
| std_err_file | Stderr log path | No | None (stderr discarded) |
| run_calendar | Named calendar for scheduling | No | None (no calendar) |
| exclude_calendar | Exclude dates from run_calendar | No | None (no exclusion) |
| box_name | Parent box | No | None (not in box) |
| box_terminator | Kill whole box on failure | No | 0 (no) |
| notification | Email notification method | No | None |
🎯 Key Takeaways
- Always set std_out_file and std_err_file on every CMD job — they are your primary debugging tools
- date_conditions: 1 must be set for start_times to take effect — without it, time-based scheduling is disabled
- n_retrys: 3 means 3 retries after initial failure — the job runs up to 4 times total
- term_run_time terminates a hung job after N minutes — critical for preventing downstream job pile-ups
- Permissions matter in shared environments — use permission attribute to control access
- Calendars centralise scheduling — one change affects all jobs referencing that calendar
- Use box_terminator sparingly — only for jobs whose failure invalidates the entire box
⚠ Common Mistakes to Avoid
Interview Questions on This Topic
- QWhat does the date_conditions attribute do in AutoSys JIL?JuniorReveal
- QWhat is the difference between n_retrys and restarting a job manually?Mid-levelReveal
- QWhat attributes control failure notifications in AutoSys?SeniorReveal
- QWhat does term_run_time do and why is it important?JuniorReveal
- QIf a job has n_retrys: 3 and fails every time, how many times does it actually run?JuniorReveal
- QExplain the difference between box_terminator and job_terminator.SeniorReveal
Frequently Asked Questions
What is date_conditions in AutoSys?
date_conditions controls whether time-based scheduling (start_times, days_of_week, run_calendar) is active for a job. Set to 1 to enable time-based scheduling; set to 0 to disable it. If date_conditions is 0, the job only runs when triggered by a condition (another job's success/failure) or manually.
How does n_retrys work in AutoSys?
n_retrys specifies how many times AutoSys automatically retries a failed job before declaring it a final FAILURE. If n_retrys is 3 and the job fails, AutoSys retries 3 times for a total of 4 attempts. After all retries are exhausted, the job moves to FAILURE status.
What happens if term_run_time is not set?
Without term_run_time, a job that hangs or runs indefinitely will continue forever. This can block all downstream jobs waiting on it. Always set a reasonable term_run_time to ensure hung jobs are terminated automatically.
What is the box_terminator attribute in AutoSys?
box_terminator: 1 marks a job as the 'kill switch' for its parent box. If this job fails, the entire box (and all remaining jobs in it) is terminated immediately, rather than waiting for other jobs to complete or fail.
How do I send email notifications from AutoSys?
Set alarm_if_fail: 1 and configure notification attributes: set notification: mail and notification_emailaddress: your-team@company.com. You can also customise the notification message with the notification_msg attribute, which supports placeholders like %s (job name), %m (machine), %t (time).
What is the difference between run_window and start_times?
start_times defines specific times when the job can start. run_window defines a time range during which the job is allowed to run. If a job starts at a start_time but runs past the run_window end, AutoSys terminates it. run_window is useful for batch windows (e.g., overnight only).
Can I use both date_conditions and condition together?
Yes. When both are present, the job starts only when the time conditions are satisfied AND the condition dependencies are met. This is common for jobs that run at a specific time but wait for upstream tasks to finish.
Developer and founder of TheCodeForge. I built this site because I was tired of tutorials that explain what to type without explaining why it works. Every article here is written to make concepts actually click.