JIL insert_job, update_job, and delete_job — Managing AutoSys Jobs
- 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.jilbefore making changes
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: 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"
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.
/* 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
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 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
/* AutoSys/JIL: Successfully deleted box: legacy_eod_box (5 jobs removed) */
autorep -J jobname -q > backup.jil before any delete operation. Once a job is deleted from the Event Server, the history is also gone.| Subcommand | Creates? | Modifies? | Full replacement? | Deletes? |
|---|---|---|---|---|
| insert_job | Yes — new only | No — fails if exists | N/A | No |
| update_job | No — fails if not exists | Yes — partial update | No — only changed attrs | No |
| delete_job | No | No | No | Job only |
| delete_box | No | No | No | Box + 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.jilbefore 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.
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.