AutoSys delete_box — One Command Wiped 47 Payroll Jobs
Using delete_box instead of delete_job made 47 payroll jobs vanish.
20+ years shipping production infrastructure and CI/CD at scale. Notes here come from systems that actually shipped.
- insert_job creates new job definitions. Fails if the job already exists.
- update_job modifies only the attributes you specify — partial update, not replacement.
- delete_job removes a single job. delete_box removes the box plus all child jobs.
- Each command uses JIL syntax; a typo or missing required attribute stops the entire batch.
- Production insight: delete_box is the most dangerous — it silently wipes entire job trees.
- Biggest mistake: assuming update_job is a full rewrite — it's not, and omitted attributes stay unchanged.
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. You'll see them in every single batch pipeline. And you'll screw them up at least once.
Why One jil Command Can Wipe Out 47 Payroll Jobs
The jil insert, update, and delete operations are the core commands for managing AutoSys job definitions via the command-line interface. Insert creates a new job definition from a JIL script, update modifies an existing job's attributes, and delete removes a job entirely from the AutoSys database. The critical mechanic: these commands operate on the job definition, not the job instance — a delete command removes the job permanently, including all future scheduled runs.
In practice, jil commands are executed against the AutoSys Event Processor, which immediately commits changes to the database. There is no staging area or undo. A single jil delete command with a wildcard or mis-specified job name can remove hundreds of jobs in seconds. The command syntax is straightforward: jil -d "delete_job: job_name" — but the lack of a confirmation prompt is the dangerous part.
Use jil insert/update/delete when you need to programmatically manage job definitions in batch, such as during deployment automation or disaster recovery. The real-world impact: a junior operator running a script with an incorrect job name pattern can delete an entire application's job stream. Production teams must implement strict access controls and always test delete commands in a sandbox environment first.
jil -q "show_job: PAYROLL_*") and require a second operator approval for any delete command targeting more than 5 jobs.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.
autorep -J newjob -q after insertion — a silent failure (like a typo in machine name) can leave the job orphaned.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.
start_times: "").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.
autorep -J jobname -q > backup.jil before any delete operation. Once a job is deleted from the Event Server, the history is also gone.Common pitfalls when using JIL subcommands
Even experienced AutoSys admins make mistakes with these commands. The most common: confusing insert and update, forgetting that update is partial, running delete_box when you meant delete_job, and not backing up before deletion. Also: JIL syntax is finicky about whitespace. A missing colon after the subcommand attribute name will cause a parse error.
- POST (insert_job) fails if resource exists.
- PATCH (update_job) only changes included fields.
- DELETE (delete_job) removes one resource.
- Cascading DELETE (delete_box) removes a collection and all its children.
Automating job lifecycle management with scripts
In production, you'll rarely run JIL commands one by one. Instead, you'll build scripts that generate JIL files dynamically and pipe them to the jil command. A common pattern: loop over a list of jobs, check existence, then choose insert or update. Another: after a code deployment, you update batch schedules en masse by generating JIL from a template.
The Atomicity Lie: Why job_defs Fail on Partial Changes
You think you're updating one field. You're actually overwriting the entire job definition. That's how autorepeat gets silently stripped when you only wanted to change the machine. Every time you run update_job, Autosys treats it as a wholesale replacement — fields you omit are reset to their defaults, not left untouched.
Proof of the wound: You push a script that updates command on a critical job. Next morning, alerting fails because alarm_if_fail is gone. You didn't delete it. Autosys did. Because your JIL didn't mention it.
The fix is brutal but simple: always pipe the current job definition through autorep -q, parse it, and inject only the changed attributes. Never hand-write an update_job from memory. Script it. Save yourself the 2am war room.
autorep -q output is your source of truth. If you're not capturing every field, you're gambling.The Cascade Problem: delete_job on a Box Job Will Nuke Your Dependency Chain
You remove a box job. Autosys doesn't warn you. It just deletes the box and every job inside it — no confirmation, no prompt, no undo. One command, forty-three jobs gone. The scheduler won't even tell your monitoring tools.
This isn't a bug. It's the design. Box jobs own their children. Delete the parent, the children die with it. No dependency tree validation. No 'are you sure?' flag.
The workaround is paranoid but fast: before you delete any box, dump its contents with autorep -B. Then delete jobs bottom-up. Children first. Then the box. If you bulk-delete with a script, add a dry-run mode that lists every job that will be removed. Make it print a count. Force a confirmation with a checksum — "type 'I_KNOW_47_JOBS_WILL_DIE' to continue."
Your production scheduler is not a playground. Treat every delete like a database drop.
autorep -B gives you the full tree. Use it.ACID Properties of SQL Transactions & Command Reference
JIL uses an embedded SQLite database, so every insert_job, update_job, or delete_job is an implicit SQL transaction. Understanding ACID—Atomicity, Consistency, Isolation, Durability—explains why partial job_defs fail silently. The BEGIN TRANSACTION command explicitly starts a multi-statement block, preventing partial writes. Use SAVEPOINT to mark a rollback point within a transaction. ROLLBACK TO SAVEPOINT undoes changes after that marker without aborting the whole transaction. RELEASE SAVEPOINT discards the marker without affecting data. These commands matter when scripting bulk job changes: a failed update in the middle won't corrupt 47 payroll jobs because you can roll back to a safe state before the batch. Without explicit transactions, Autosys treats each JIL statement independently, masking errors until job execution.
Types of SQL Transactions & Optimization Strategies
JIL transactions fall into three types: implicit single-statement (default, one job per commit), explicit multi-statement (BEGIN/COMMIT block), and nested subtransactions (via SAVEPOINT). Implicit transactions are fast but dangerous for cascading changes like delete_job on a box. Explicit transactions allow atomic box deletes that roll back if any child job fails. Nested transactions help when updating dependency chains across multiple boxes. Optimization starts with minimizing transaction scope: commit small batches (5-10 jobs) rather than 500-job transactions to avoid table-level locks that stall the Autosys Event Processor. Use SAVEPOINT only when necessary—excessive savepoints bloat the transaction log. For bulk imports, disable triggers during the transaction (ALTER TABLE disables) then re-enable. Monitor job_def transactions in the $AUTOUSER/sqlite directory for disk I/O spikes. Batching with explicit transactions cut our job definition load time by 63%.
The Quiet Box Deletion That Killed a Payroll Batch
- Never use delete_box without a full autorep -q backup of the entire box tree.
- Always run
autorep -J boxname -q | grep job_namefirst to see what you're about to delete. - Consider renaming delete_box to something less lethal in your runbook — or just ban it in production.
autorep -J jobname to confirm. Use update_job instead. Never try to delete and re-insert — you'll lose history.autorep -J jobname -d. Running jobs ignore updates until next scheduled start. Also verify you spelled the attribute correctly.autorep -J %keyword% to search. Remember: case-sensitive. Also check global vs local instance.autorep -J jobname -q | grep -i 'job_type|machine|owner'jil < backup.jil (if backup exists) to compare working syntax.Key takeaways
autorep -J jobname -q > backup.jil before making changesCommon mistakes to avoid
5 patternsUsing insert_job on an existing job
Using delete_box when you only want to remove the box container
Not backing up job definitions before delete operations
autorep -J jobname -q > backup.jil before any delete. Store backups in version control.Forgetting that update_job is partial — can't clear an attribute by omitting it
condition: "" or start_times: "".Assuming JIL syntax errors are obvious
autorep -J jobname -q after every JIL operation. Never trust the 'success' output alone.Interview Questions on This Topic
What is the difference between insert_job and update_job?
Frequently Asked Questions
20+ years shipping production infrastructure and CI/CD at scale. Notes here come from systems that actually shipped.
That's AutoSys. Mark it forged?
4 min read · try the examples if you haven't