Home DevOps JIL insert_job, update_job, and delete_job — Managing AutoSys Jobs

JIL insert_job, update_job, and delete_job — Managing AutoSys Jobs

Where developers are forged. · Structured learning · Free forever.
📍 Part of: AutoSys → Topic 9 of 30
Learn how to create, modify, and delete AutoSys jobs using JIL subcommands: insert_job, update_job, delete_job, and delete_box.
🧑‍💻 Beginner-friendly — no prior DevOps experience needed
In this tutorial, you'll learn:
  • insert_job creates new jobs; update_job modifies existing ones (partial update only); delete_job removes a single job
  • delete_box removes a box AND all its child jobs — use delete_job on the box name to remove only the box while keeping children
  • Always back up job definitions with autorep -J jobname -q > backup.jil before making changes
✦ Plain-English analogy ✦ Real code with output ✦ Interview questions
⚡ Quick Answer
insert_job is like hiring a new employee and filling out their paperwork. update_job is like updating their job description without rehiring them. delete_job is like terminating that employee and removing their record.

Managing jobs in AutoSys means mastering three JIL subcommands: insert_job to create, update_job to modify, and delete_job to remove. These are the bread-and-butter operations you'll perform every week as an AutoSys administrator or developer.

insert_job — creating a new job

insert_job creates a brand-new job definition in the AutoSys Event Server. The job name must be unique within the instance. All required attributes (job_type, machine for CMD jobs, owner) must be included. You cannot insert_job if a job with that name already exists — use update_job instead.

insert_job.jil · BASH
12345678910111213
insert_job: daily_reconcile
job_type: CMD
command: /opt/scripts/reconcile.sh
machine: finance-server-01
owner: finuser
date_conditions: 1
days_of_week: mon-fri
start_times: "05:00"
std_out_file: /logs/autosys/daily_reconcile.out
std_err_file: /logs/autosys/daily_reconcile.err
alarm_if_fail: 1
n_retrys: 1
description: "Morning reconciliation run before market open"
▶ Output
/* AutoSys/JIL: Successfully inserted job: daily_reconcile */

update_job — modifying an existing job

update_job modifies an existing job definition. You only need to include the attributes you want to change — everything else stays as it was. This is a partial update, not a full replacement.

update_job.jil · BASH
1234567891011
/* Change only the start time — everything else unchanged */
update_job: daily_reconcile
start_times: "04:30"

/* Add a condition to an existing job */
update_job: generate_report
condition: success(daily_reconcile)

/* Change the machine a job runs on */
update_job: daily_reconcile
machine: finance-server-02
▶ Output
/* AutoSys/JIL: Successfully updated job: daily_reconcile */
🔥
update_job takes effect immediately for future runsIf the job is currently RUNNING, the update applies to the next run. If the job is scheduled and not yet running, the update applies to the current scheduled run.

delete_job and delete_box

delete_job removes a single job. delete_box removes a box and ALL jobs inside it. Always back up definitions before deleting.

delete_jobs.jil · BASH
12345678910
/* Delete a single job */
delete_job: old_report_job

/* Delete a box AND all inner jobs */
delete_box: legacy_eod_box

/* SAFER: backup first, then delete */
# autorep -J old_report_job -q > /tmp/old_report_job_backup.jil
# Then review the backup, then:
delete_job: old_report_job
▶ Output
/* AutoSys/JIL: Successfully deleted job: old_report_job */
/* AutoSys/JIL: Successfully deleted box: legacy_eod_box (5 jobs removed) */
⚠️
Always backup before deleteRun autorep -J jobname -q > backup.jil before any delete operation. Once a job is deleted from the Event Server, the history is also gone.
SubcommandCreates?Modifies?Full replacement?Deletes?
insert_jobYes — new onlyNo — fails if existsN/ANo
update_jobNo — fails if not existsYes — partial updateNo — only changed attrsNo
delete_jobNoNoNoJob only
delete_boxNoNoNoBox + all children

🎯 Key Takeaways

  • insert_job creates new jobs; update_job modifies existing ones (partial update only); delete_job removes a single job
  • delete_box removes a box AND all its child jobs — use delete_job on the box name to remove only the box while keeping children
  • Always back up job definitions with autorep -J jobname -q > backup.jil before making changes
  • update_job only requires the attributes you want to change — omitted attributes keep their current values

⚠ Common Mistakes to Avoid

  • Using insert_job on an existing job — it fails; use update_job
  • Using delete_box when you only want to remove the box — use delete_job on the box name to keep children
  • Not backing up job definitions before delete operations
  • Forgetting that update_job is partial — you can't clear an attribute by omitting it; you must explicitly set it to empty or 0

Interview Questions on This Topic

  • QWhat is the difference between insert_job and update_job?
  • QIf you want to delete a box but keep its inner jobs, which command do you use?
  • QHow do you back up an AutoSys job definition before modifying it?
  • QCan you use update_job on a job that doesn't exist yet?
  • QWhat happens to history when you delete an AutoSys job?

Frequently Asked Questions

Can you use insert_job to update an existing AutoSys job?

No. insert_job will fail if a job with that name already exists. Use update_job to modify an existing job.

Does update_job require all attributes?

No. update_job is a partial update — you only specify the attributes you want to change. All other attributes keep their current values.

What is the difference between delete_job and delete_box?

delete_job removes a single job. When used on a box, it removes only the box — the inner jobs become standalone. delete_box removes the box AND all inner jobs in one operation.

How do I recover a deleted AutoSys job?

If you took a backup with autorep -J jobname -q > backup.jil before deleting, you can re-insert it with jil < backup.jil. Without a backup, the job definition is gone.

Can I rename an AutoSys job?

Not directly. AutoSys doesn't have a rename command. To rename a job, export the definition with autorep -q, modify the job name in the JIL file, insert the new version with insert_job, then delete the old one with delete_job.

🔥
Naren Founder & Author

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.

← PreviousJIL Attributes Complete ReferenceNext →Box Jobs and Nested Boxes in AutoSys
Forged with 🔥 at TheCodeForge.io — Where Developers Are Forged