Home β€Ί DevOps β€Ί AutoSys n_retrys and term_run_time: Rerun Failed Jobs and Kill Hung Ones
Intermediate 3 min · December 4, 2026

AutoSys n_retrys and term_run_time: Rerun Failed Jobs and Kill Hung Ones

n_retrys reruns a failed AutoSys job immediately, up to N times; term_run_time kills a job that runs longer than N minutes.

N
Naren Founder & Principal Engineer

20+ years shipping production infrastructure and CI/CD at scale. Notes here come from systems that actually shipped.

Follow
✓ Production
production tested
December 04, 2026
last updated
2,144
articles · all by Naren
Before you start⏱ 7 min
  • ✓AutoSys JIL basics
 ● Production Incident 🔎 Debug Guide
⚡Quick Answer
  • n_retrys: 2 = up to 2 extra runs after a FAILURE, started right away.
  • Retries help with short blips (a network hiccup, a brief lock), not with outages.
  • For a planned outage, move start_times or add a condition on a check job.
  • term_run_time: 60 = AutoSys kills the job after 60 minutes; status TERMINATED.
  • max_run_alarm only raises an alarm; term_run_time actually stops the job.
  • Set term_run_time well above the longest normal run.
✦ Definition~90s read
What is AutoSys n_retrys and term_run_time?

n_retrys and term_run_time are AutoSys job attributes. n_retrys sets how many times AutoSys reruns a job after it fails. term_run_time sets a maximum run time in minutes; when it's reached, AutoSys kills the job and it ends TERMINATED.

β˜…
n_retrys is 'try again if it fails', with no pause in between.
Plain-English First

n_retrys is 'try again if it fails', with no pause in between. term_run_time is an egg timer: when it rings, the job is stopped no matter what.

LOAD_GL had n_retrys: 2, so the team expected it to survive the database maintenance window. All three runs failed within two minutes.

n_retrys in JIL

Set the number of reruns on the job definition. Each failure uses one; when they're gone, the job stays in FAILURE and alarms fire as usual.

retry.jilJIL
1
2
update_job: LOAD_GL
n_retrys: 2
🎯 Key Takeaway
Retries are immediate.

term_run_time in JIL

Value is in minutes. When the job reaches it, AutoSys kills the process and sets TERMINATED. Dependent jobs waiting on s(LOAD_GL) won't start.

kill.jilJIL
1
2
3
update_job: LOAD_GL
term_run_time: 120
max_run_alarm: 60
🎯 Key Takeaway
A kill switch for hung jobs.

See retries and run times

Use the run history to see each attempt and how long it took.

history.shBASH
1
2
autorep -J LOAD_GL -r -5
autorep -J LOAD_GL -q | grep -E 'n_retrys|term_run_time'
🎯 Key Takeaway
Check before tuning.
● Production incidentPOST-MORTEMseverity: high

Three Failures in Two Minutes

Symptom
LOAD_GL FAILURE, exit 1, three runs between 02:12 and 02:14.
Assumption
n_retrys would wait out the maintenance window.
Root cause
Retries start immediately. Maintenance ran 02:00 to 02:30, so all three runs hit it.
Fix
Moved start_times to 02:40 and kept n_retrys: 1 for short blips. Added term_run_time: 120 after a hang a week later.
Key lesson
  • Retries don't wait.
  • Schedule around known outages.
  • Use term_run_time to stop hung jobs.
Production debug guideWork through these in order4 entries
Symptom · 01
Job failed several times within minutes
→
Fix
Check the job's run history with autorep -J JOB -r -N; retries show as separate runs.
Symptom · 02
Job failed during a known outage
→
Fix
Move start_times past the outage or add a condition; don't raise n_retrys.
Symptom · 03
Job hangs for hours
→
Fix
Add term_run_time a safe margin above the normal run time.
Symptom · 04
Job ended TERMINATED unexpectedly
→
Fix
Compare the run time with term_run_time; a slow night may need a higher limit.
⚙ Quick Reference
3 commands from this guide
FileCommand / CodePurpose
retry.jilupdate_job: LOAD_GLn_retrys in JIL
kill.jilupdate_job: LOAD_GLterm_run_time in JIL
history.shautorep -J LOAD_GL -r -5See retries and run times

Key takeaways

1
n_retrys reruns immediately.
2
Schedule around outages.
3
term_run_time kills; max_run_alarm warns.

Common mistakes to avoid

3 patterns
×

Raising n_retrys to cover an outage

Symptom
Still fails, just more times.
Fix
Move the start time or add a condition.
×

term_run_time too close to the normal run

Symptom
Slow nights end TERMINATED.
Fix
Set it well above the longest normal run.
×

Expecting max_run_alarm to stop the job

Symptom
The job keeps running.
Fix
Use term_run_time to stop it.
INTERVIEW PREP · PRACTICE MODE

Interview Questions on This Topic

Q01SENIOR
What's the difference between max_run_alarm and term_run_time?
Q02SENIOR
Does n_retrys wait between attempts?
Q01 of 02SENIOR

What's the difference between max_run_alarm and term_run_time?

ANSWER
max_run_alarm raises an alarm when the job runs longer than N minutes; the job keeps running. term_run_time kills the job at N minutes and it ends TERMINATED.
FAQ · 3 QUESTIONS

Frequently Asked Questions

01
Does n_retrys add a delay between retries?
02
What status does a job killed by term_run_time get?
03
Is term_run_time in minutes?
RESOURCES

Keep going

AutoSys Full Course for Beginners▶
WatchAutoSys Full Course for BeginnersJIL, job statuses, monitoring and failed jobs, start to finish.Watch on YouTube →
ReadThe complete DevOps guideOne deep guide that walks the whole DevOps track in order.Start reading →
Q
PracticeDevOps Interview QuestionsReal interview questions with answers, by topic.Practice now →
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. Notes here come from systems that actually shipped.

Follow
✓ Verified
production tested
December 04, 2026
last updated
2,144
articles · all by Naren
🔥

That's AutoSys. Mark it forged?

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

←
Previous
Control-M Interview Questions: 40 Real Production Q&As
52 / 53 · AutoSys
Next
AutoSys Job Permission Denied: Job Owner
→