AutoSys sendevent Command — FORCE_STARTJOB Pitfalls
FORCE_STARTJOB bypasses file_watcher and calendar checks—one midnight run caused 12 hours of missing ETL data.
20+ years shipping production infrastructure and CI/CD at scale. Drawn from code that ran under real load.
- sendevent sends signals to the AutoSys Event Processor to control jobs
- Common events: FORCE_STARTJOB, STARTJOB, KILLJOB, JOB_ON_HOLD, CHANGE_STATUS
- Use -E for event type and -J for job name; -S for instance name
- Performance: bulk events without sleep can overwhelm the Event Processor queue
- Production insight: sending FORCE_STARTJOB when dependencies are unmet can cause silent data corruption
- Biggest mistake: assuming STARTJOB runs the job immediately — it only works if conditions are satisfied
sendevent is the remote control for your AutoSys jobs. Just like a TV remote sends signals to change channels, sendevent sends signals to AutoSys to change what a job is doing — start it, stop it, put it on hold, release it, kill it.
sendevent is one of the most frequently used AutoSys commands in day-to-day operations. Every manual job control action — starting a job, putting it on hold, killing it, setting a global variable — goes through sendevent. It's the command-line interface to the AutoSys event system. If you've ever triggered a production outage because you sent the wrong event, you know exactly why this reference exists.
What the AutoSys sendevent Command Actually Does
The sendevent command is the sole mechanism for injecting events into an AutoSys event server, which then triggers job state transitions. Its core mechanic is simple: you specify an event type (e.g., FORCE_STARTJOB, KILLJOB, CHANGE_STATUS) and a job name, and the command writes a structured event record into the event server's queue. The event server processes this record asynchronously, applying the requested state change only if the job's current state permits it.
In practice, sendevent is a fire-and-forget operation — it returns immediately after queuing the event, not after the job actually transitions. This means a successful exit code (0) does not guarantee the job started or stopped. The event server's processing delay is typically sub-second, but under load (e.g., 500+ concurrent events) it can stretch to seconds. Also, the command respects job dependencies and machine availability; a FORCE_STARTJOB will fail silently if the job's machine is down or the job is already running.
You use sendevent when you need to manually override AutoSys scheduling logic — for example, forcing a job to run outside its normal schedule during a production incident, or killing a stuck job that has exceeded its max run time. It is the operational equivalent of a manual override switch, and misusing it (e.g., FORCE_STARTJOB on a job with unresolved upstream failures) can cascade into inconsistent system state.
sendevent syntax and key options
The basic syntax is: sendevent -E event_type -J job_name. The -E flag specifies the event type, -J the job name. Most commands also support -S for the AutoSys instance name if you have multiple environments. Always use single quotes around job names if they contain special characters. The event types are case-sensitive — KILLJOB works, killjob doesn't.
CHANGE_STATUS — manually overriding job status
CHANGE_STATUS lets you manually set a job to SUCCESS or FAILURE. This is used in recovery scenarios: if a job failed but the issue has been resolved manually outside AutoSys, you can mark it SUCCESS so downstream jobs can proceed. But be careful: you're lying to the scheduler, and downstream jobs may trust the data that never arrived. Use it only when you have verified the work is complete.
Using sendevent in shell scripts for automation
sendevent becomes especially powerful when used inside shell scripts for batch recovery automation. Instead of manually sending events one by one, you can script common operational patterns — like automatically restarting all failed jobs, or setting a global variable and triggering a downstream job in sequence. But there are traps: looping without a sleep can flood the Event Processor, and forgetting to quote variable expansions can break the command.
sendevent Event Types Deep Dive — When to Use Each
Beyond the common events, there are less frequently used but critical ones: DELETEJOB to remove jobs, RESTART to restart a failed job (respects conditions), STOP_DEMON for graceful shutdown, and SET_GLOBAL for variables. Understanding the nuances — like RESTART only works on FAILURE jobs, or that JOB_ON_ICE prevents the job from running indefinitely until explicitly released — can prevent outages.
- Events are queued and processed asynchronously by the Event Processor
- There's a small delay (milliseconds to a few seconds) between sending and the job reacting
- Multiple events for the same job are processed in order, but events for different jobs may interleave
- Persistent events (like STOP_DEMON) override later related events
sendevent Troubleshooting and Common Failures
When sendevent 'does nothing', the culprit is almost always one of: wrong instance name, job name typo, case mismatch, or the Event Processor is down. Other issues: sending FORCE_STARTJOB to a box job (which may be running), or forgetting that JOB_ON_HOLD doesn't affect a job already running — you need KILLJOB first. This section gives you the debug flow to resolve 90% of issues in under a minute.
Firing Multiple Events: The at() Trick for Batch Operations
Running sendevent once per job is for amateurs. When you need to kill, force-start, or change status on fifty jobs simultaneously, you don't write a fifty-line script. You use the at() time specifier.
at() accepts a comma-delimited list of job names inside the parentheses. That means one command, one connection to the Event Processor, one trace log entry. It's faster, cleaner, and less likely to hit race conditions when you're freezing an entire pipeline.
The gotcha: at() only works with event types that accept multiple targets — CHANGE_STATUS, FORCE_START, KILLJOB. It does not work with COMMENT, ALARM, or SEND_SIGNAL. Check the sendevent documentation before you batch, or you'll get a silent partial failure.
at() for batch operations, but always confirm job names exist before the command hits production.Event Log Spam: How to Avoid Flooding the Autosys Event Processor
Every sendevent call generates an entry in the Event Processor log and a record in the autosyslog. That's fine for a handful of events. But when your automation loops over 200 jobs every five minutes, you're generating sixty thousand log entries an hour. The Event Processor doesn't care, but your capacity planning and troubleshooting just became a nightmare.
Filter before you fire. If you're only changing status on jobs that are in a specific state, check first. Don't send a FORCE_START to a job that's already RUNNING — it'll be ignored, but it still gets logged. Use autosys_showjob or a quick grep against the sendevent cache before you issue the command.
Second rule: batch with at() as covered above. Three events instead of three hundred. Your future self, three weeks into a post-mortem, will thank you.
Third rule: use the -T flag to set a termination time for events that might never finish. A CHANGE_STATUS to FORCE_START with no -T means the job runs forever. That's fine for normal batch, but for emergency recovery? Set a max runtime.
The midnight FORCE_STARTJOB that ran ETL before the source data arrived
sendevent -E RESTART -J jobname which respects conditions. Alternatively, verify the upstream state manually before forcing.- FORCE_STARTJOB is for emergencies — always verify the reason the job is waiting first
- When in doubt, use STARTJOB or RESTART, not FORCE_STARTJOB
- Document in your runbook: which jobs can be force-started and which cannot
autorep -q jobname | grep -E 'Status|Event'autorep -W -s ALL | grep jobnameKey takeaways
Common mistakes to avoid
6 patternsUsing STARTJOB when you meant FORCE_STARTJOB
Using FORCE_STARTJOB without understanding what conditions it's bypassing
Forgetting -S instance_name in multi-instance environments
Using KILLJOB on a job that's in a BOX and expecting the box to continue normally
Sending multiple events rapidly in a loop without a pause
Assuming JOB_ON_ICE is same as JOB_ON_HOLD
Interview Questions on This Topic
What is the sendevent command used for in AutoSys?
Frequently Asked Questions
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.
20+ years shipping production infrastructure and CI/CD at scale. Drawn from code that ran under real load.
That's AutoSys. Mark it forged?
4 min read · try the examples if you haven't