AutoSys sendevent Command — Complete Reference
- sendevent is the primary command for manually controlling AutoSys job execution and state
- FORCE_STARTJOB bypasses all conditions; STARTJOB respects them — use FORCE_STARTJOB carefully in production
- CHANGE_STATUS -s SUCCESS is a recovery tool to unblock dependency chains when a job was fixed manually
- 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 Quick Debug Cheat Sheet
Event sent but job status unchanged
autorep -q jobname | grep -E 'Status|Event'autorep -W -s ALL | grep jobnameFORCE_STARTJOB looks ignored
autorep -q jobname | grep -i 'hold\|ice'sendevent -E JOB_OFF_HOLD -J jobnameDownstream job not running after CHANGE_STATUS SUCCESS
autorep -j downstream_job | grep -E 'Condition|Start_times|date_conditions'sendevent -E STARTJOB -J downstream_jobsendevent hangs with no output
ping event_processor_host # or check $AUTOUSER/.autosysps -ef | grep autoevent*Production Incident
sendevent -E RESTART -J jobname which respects conditions. Alternatively, verify the upstream state manually before forcing.Production Debug GuideSymptom → Action guide for when events don't work as expected
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.
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.
# Basic syntax sendevent -E EVENT_TYPE -J job_name # For a specific AutoSys instance sendevent -E EVENT_TYPE -J job_name -S INSTANCE_NAME # ── The most common sendevent operations ────────────────────────── # Force start a job (run immediately regardless of conditions) sendevent -E FORCE_STARTJOB -J daily_report # Start a job normally (only if conditions are met) sendevent -E STARTJOB -J daily_report # Kill a running job sendevent -E KILLJOB -J daily_report # Put a job on hold (won't run until released) sendevent -E JOB_ON_HOLD -J daily_report # Release a job from hold sendevent -E JOB_OFF_HOLD -J daily_report # Put a job on ice (stronger suspension) sendevent -E JOB_ON_ICE -J daily_report # Release from ice sendevent -E JOB_OFF_ICE -J daily_report # Delete a job via event sendevent -E DELETEJOB -J old_legacy_job # Manually change a job's status sendevent -E CHANGE_STATUS -J job_name -s SUCCESS # Set a global variable sendevent -E SET_GLOBAL -G "TRADE_COUNT=5432" # Stop the Event Processor gracefully sendevent -E STOP_DEMON
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.
# Manually mark a job as SUCCESS (to unblock downstream dependencies) sendevent -E CHANGE_STATUS -J extract_job -s SUCCESS # Manually mark a job as FAILURE (to block downstream from starting) sendevent -E CHANGE_STATUS -J questionable_job -s FAILURE # After CHANGE_STATUS to SUCCESS, downstream jobs that were waiting # will now evaluate their conditions and may start automatically
Downstream job 'transform_job' condition now met — starting */
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.
#!/bin/bash # Auto-restart all FAILURE jobs matching a pattern PATTERN="PRD_TRADING_%" echo "Checking for failed jobs matching: $PATTERN" FAILED_JOBS=$(autorep -J $PATTERN -s FA | awk 'NR>2 {print $1}' | grep -v '^$') if [ -z "$FAILED_JOBS" ]; then echo "No failed jobs found" exit 0 fi for JOB in $FAILED_JOBS; do echo "Restarting: $JOB" sendevent -E RESTART -J "$JOB" sleep 2 # brief pause between events to avoid overwhelming Event Processor done echo "Restart events sent for: $(echo $FAILED_JOBS | wc -w) jobs" # Pattern 2: Set a global, then trigger downstream job RECORD_COUNT=$(wc -l < /data/processed.csv) sendevent -E SET_GLOBAL -G "TRADING_COUNT=${RECORD_COUNT}" sendevent -E STARTJOB -J PRD_TRADING_VALIDATE_COUNT
Restarting: PRD_TRADING_EXTRACT_DAILY
Restarting: PRD_TRADING_TRANSFORM_DAILY
Restart events sent for: 2 jobs
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.
# RESTART - only works if job status is FAILURE or has next cycle pending sendevent -E RESTART -J export_daily # re-runs with original conditions # DELETEJOB - removes job definition permanently; use with extreme care sendevent -E DELETEJOB -J old_job # SET_GLOBAL - sets a global variable visible to all jobs sendevent -E SET_GLOBAL -G "ENVIRONMENT=STAGING" # SENDSTATUS - sends an application status (rarely used, but available) sendevent -E SENDSTATUS -J my_job -s "Data validated OK" # STOP_DEMON - graceful shutdown of Event Processor sendevent -E STOP_DEMON # START_DEMON - restart Event Processor (usually via script, not sendevent) # NOTE: There is no START_DEMON event; use the autostart mechanism
- 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.
# Step 1: Is the Event Processor running? autorep -W # returns NOSUCH? If yes, Event Processor is down # Step 2: What is the job's current status? autorep -q jobname | head -20 # Step 3: Check event log for recent events tail -100 $AUTOUSER/events/events.log | grep jobname # Step 4: Verify job name spelling and case autorep -J "JOBNAME*" | grep -i jobname # Step 5: Test connectivity to Event Processor host ping autoevent_host # Step 6: Check for multiple instances sendevent -E PING # sends a test event; responds with 'PONG' from Event Processor
Job: daily_report
Status: FAILURE
...
| Event | What it does | Respects conditions? |
|---|---|---|
| STARTJOB | Triggers job if conditions met | Yes |
| FORCE_STARTJOB | Starts job immediately, bypasses conditions | No |
| KILLJOB | Terminates running job | N/A |
| JOB_ON_HOLD | Suspends job (reversible) | N/A |
| JOB_OFF_HOLD | Releases job from hold | Yes — runs if conditions met |
| JOB_ON_ICE | Strongly suspends job | N/A |
| JOB_OFF_ICE | Releases from ice (waits for next cycle) | Yes — waits for next occurrence |
| CHANGE_STATUS | Manually sets job status | N/A |
| SET_GLOBAL | Sets a global variable value | N/A |
| STOP_DEMON | Gracefully stops Event Processor | N/A |
🎯 Key Takeaways
- sendevent is the primary command for manually controlling AutoSys job execution and state
- FORCE_STARTJOB bypasses all conditions; STARTJOB respects them — use FORCE_STARTJOB carefully in production
- CHANGE_STATUS -s SUCCESS is a recovery tool to unblock dependency chains when a job was fixed manually
- Always use sendevent -E STOP_DEMON to stop the Event Processor — never kill -9
- When debugging, start with autorep -W, then -q, then check the event log
- Add a sleep between bulk sendevent calls to avoid overwhelming the Event Processor
- JOB_ON_ICE is persistent; JOB_ON_HOLD is reversible. Understand the difference before suspending jobs
⚠ Common Mistakes to Avoid
Interview Questions on This Topic
- QWhat is the sendevent command used for in AutoSys?JuniorReveal
- QWhat is the difference between STARTJOB and FORCE_STARTJOB?JuniorReveal
- QHow do you put an AutoSys job on hold using the command line?Mid-levelReveal
- QWhat does CHANGE_STATUS do and when would you use it?Mid-levelReveal
- QHow do you gracefully stop the AutoSys Event Processor?Mid-levelReveal
- QExplain how you would debug a sendevent command that appears to do nothing.SeniorReveal
Frequently Asked Questions
What is the sendevent command in AutoSys?
sendevent is the AutoSys command-line tool for sending events to the Event Processor. It's used to manually start, stop, hold, ice, kill, or change the status of jobs, as well as set global variables and control the Event Processor itself.
What is the difference between STARTJOB and FORCE_STARTJOB?
STARTJOB triggers a job only if its starting conditions (date_conditions, condition attribute) are currently satisfied. FORCE_STARTJOB starts the job immediately regardless of whether conditions are met — it bypasses all condition checks.
How do I manually start an AutoSys job from the command line?
Use sendevent -E FORCE_STARTJOB -J jobname to start immediately regardless of conditions, or sendevent -E STARTJOB -J jobname to start only if conditions are met.
When would you use CHANGE_STATUS in AutoSys?
CHANGE_STATUS is a recovery tool. Use it to mark a job as SUCCESS when the actual processing completed correctly outside of AutoSys, or when an infrastructure failure caused the job to fail even though the work was done. This unblocks downstream jobs waiting on the dependency.
How do I stop the AutoSys Event Processor?
Use sendevent -E STOP_DEMON. This sends a graceful shutdown signal. Never use kill -9 — it can leave jobs in inconsistent states requiring manual cleanup before restart.
What is the difference between JOB_ON_HOLD and JOB_ON_ICE?
JOB_ON_HOLD suspends the job temporarily. When released with JOB_OFF_HOLD, the job will run immediately if its conditions are met. JOB_ON_ICE is stronger — even after JOB_OFF_ICE, the job will not run until its next scheduled occurrence (next cycle or explicit STARTJOB/FORCE_STARTJOB).
Can sendevent be used to restart a job that is currently running?
No. sendevent -E RESTART works only on jobs with status FAILURE. For a running job, you must first KILLJOB it, then use RESTART or STARTJOB.
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.