AutoSys autorep: The 1 Command That Finds Production Failures
- autorep is the primary status and reporting command — use it for checking job status, viewing definitions, and generating reports.
- % is the wildcard for job name matching; use it freely but always filter by status in large environments.
- -q outputs JIL format — use it to back up job definitions before making changes.
- autorep is AutoSys reporting command to check job status, view definitions, and generate reports — primary monitoring tool
- Key flags: -J (job name with % wildcard), -s (status filter), -d (detailed view), -q (JIL output), -M (machine status)
- Performance: autorep queries Event Server database; large environments (10K+ jobs) can take 5-10 seconds — use -s to filter before display
- Production trap: autorep -J % without filter in large environment returns 10K lines, scrolls off terminal, operator misses failures
- Biggest mistake: Not using -q to backup job definitions before bulk JIL changes — accidental delete loses all jobs with no recovery
autorep Debug Cheat Sheet
Flood of output — can't find failures
autorep -J % -s FAautorep -J % -s FA -d | grep -E 'Job Name|Exit Code'autorep slow — 30 seconds or more
autorep -J % -s RU | head -5echo 'SELECT COUNT(*) FROM AE_EVENTS WHERE EVENT_TIME < SYSDATE - 90;' | sqlplus autosys_user@autosys_dbautorep -s FA shows no failures but business complains
autorep -J suspect_job -run 1autostatus -J suspect_jobautorep -q output truncated after 2000 lines
autorep -J % -q > /tmp/all_jobs.jilautorep -J % -q | wc -lautorep -M shows agent missing but job still running on machine
ping agent_host && ssh agent_host 'ps -ef | grep autosys_agent'ssh agent_host 'tail -100 /var/log/autosys/agent.log'Production Incident
autorep -J % and saw pages of output scroll past. By the time the command finished, the terminal buffer showed only the last 100 lines. The 3 failures were not in those last 100 lines. The operator reported 'all jobs succeeded'. Three hours later, the business team asked why the reports weren't ready.-s FA filter. The team had no automated alerting for job failures, relying entirely on manual autorep checks.-s FA to filter only failures. The incident could have been prevented by filtering: autorep -J % -s FA shows only failed jobs.autorep -J % to autorep -J % -s FA to show only failures.
2. For detailed view: autorep -J % -d -s FA to see failure details (exit code, runtime).
3. Added automated monitoring: a cron job runs autorep -J % -s FA | grep -v 'No jobs match' and sends email if output non-empty.
4. Integrated with PagerDuty: critical failures trigger page to on-call engineer.
5. Wrapped autorep in a script that formats output and highlights failures in red (using ANSI colours).
6. Added terminal less to output: autorep -J % | less to scroll through large output.autorep -J % -s FA | wc -l gives failure count. Alert if > 0.Production Debug GuideSymptom → Action mapping for common autorep failures in production AutoSys environments.
autorep -J % (all jobs) not autorep -J %? Actually if 'no jobs match', your AutoSys instance may not have any jobs, or you're in wrong database. Check Event Server connection: echo 'select * from UJOBS' | sqlplus autosys_user@autosys_db to see if jobs exist.db_purge_events -date 'MM/DD/YYYY'. Also check if Event Server indexes are missing. Run analyze table on Event Server tables.autorep -J job_name -run 1 to see previous run status. Also check job logs directly: exit code may have been 0 even if business logic failed.autorep -J job_name -q > job.jil. Use -l (long format) if available in your version.ps -ef | grep autosys_agent. Restart agent, then check job status manually on the machine.autorep (short for 'auto report') is the command you'll run dozens of times every day as an AutoSys operator. It's how you check job statuses, view job definitions, and generate reports. Mastering autorep patterns makes you dramatically faster at monitoring and troubleshooting.
But autorep can be dangerous. Run autorep -J % in an environment with 10,000 jobs and you'll flood your terminal with 10,000 lines of output. The failures you care about scroll past before you see them. Without -s FA (filter failures) and -d (detailed view), you'll miss critical information. And without -q backups, an accidental jil < delete_all.jil is catastrophic.
By the end you'll know every useful autorep flag, practical query patterns for finding failed jobs, how to back up job definitions, and how to avoid the terminal-clogging trap that hides failures.
Basic autorep usage
The most common use is checking the status of one or more jobs.
# Check a single job autorep -J daily_report # Check all jobs (% is the wildcard in AutoSys) autorep -J % # Check all jobs matching a pattern autorep -J eod_% /* all jobs starting with eod_ */ autorep -J %_extract /* all jobs ending with _extract */ autorep -J etl_*_load /* wildcard in middle */ # Check all jobs inside a specific box autorep -J eod_box% # Check machine status autorep -M % /* all machines */ autorep -M prod-server-01
autorep -J % produces 10,000 lines of output. The failures you need to see scroll past in milliseconds.-s FA (failures), -s RU (running), -s PE (PEND_MACH). This reduces output to only what matters.autorep -J % without filtering in production. Use autorep -J % -s FA as your default.autorep -J % -s FA. For detailed failure info: autorep -J % -s FA -d.The -q flag — getting JIL definitions
The -q flag outputs the job definition in JIL format. This is essential for backups, auditing, and creating job templates.
# Get JIL definition of one job autorep -J daily_report -q # Backup all jobs to a file autorep -J % -q > /backup/all_jobs_$(date +%Y%m%d).jil # Backup all jobs in a box autorep -J eod_box% -q > /backup/eod_jobs_backup.jil # Compare with previous backup (useful for change auditing) diff /backup/eod_jobs_20260318.jil /backup/eod_jobs_20260319.jil
autorep -J % -q > /backup/all_jobs_$(date +%Y%m%d).jil as a daily AutoSys job itself. When someone accidentally deletes or corrupts a job, yesterday's backup saves the day.autorep -J % -q backups cost nothing but save months of recovery time. Store backups in version control (Git).diff to audit changes: diff yesterday.jil today.jil shows exactly what changed.autorep -J % -q as a scheduled AutoSys job. Store in version control for audit trail.The -d flag — detailed job information
The -d flag shows all attributes of a job including its current runtime and any active overrides — much more detail than the default status view.
# Detailed view of one job autorep -J daily_report -d # Check prior runs (-run flag) autorep -J daily_report -run 1 /* previous run */ autorep -J daily_report -run 2 /* run before that */ # Filter by status autorep -J % -s FA /* all FAILURE jobs */ autorep -J % -s RU /* all RUNNING jobs */ autorep -J % -s PE /* all PEND_MACH jobs */
-d to see actual runtime (duration), command, stdout/stderr paths, and any override attributes.autorep -J $JOB -d. Then check stdout/stderr paths from output. Always include -d in your debugging workflow.alias autobug='autorep -J $1 -d -run 1' in .profile for quick debugging.| Flag | What It Shows | Use Case | Example Command | Performance |
|---|---|---|---|---|
| (no flag) | Basic status: job name, last start, status, exit code | Quick health check | autorep -J daily_report | Fast (minimal data) |
| -d | Detailed attributes, runtime, command, log paths, overrides | Debugging failures, checking runtime, finding log files | autorep -J daily_report -d | Fast (one job) |
| -q | Full JIL definition (all attributes in JIL syntax) | Backups, auditing, creating templates, comparing changes | autorep -J % -q > backup.jil | Slow (10K jobs = 5-10 seconds) |
| -s STATUS | Filter by status code (FA, RU, SU, PE, OH, AC, IN, TE) | Finding failed jobs, monitoring running jobs, checking PEND_MACH | autorep -J % -s FA | Fast (filters at DB level) |
| -run N | Show N runs back in history (1 = previous run) | Debugging intermittent failures, checking historical runtime trends | autorep -J daily_report -run 1 | Fast |
| -M | Machine/agent status instead of jobs | Checking agent availability, seeing which jobs run on a machine | autorep -M % | Fast |
| -J pattern | Filter job names by pattern (% = wildcard) | View subset of jobs by naming convention | autorep -J eod_% | Fast (if pattern selective) |
🎯 Key Takeaways
- autorep is the primary status and reporting command — use it for checking job status, viewing definitions, and generating reports.
- % is the wildcard for job name matching; use it freely but always filter by status in large environments.
- -q outputs JIL format — use it to back up job definitions before making changes.
- -s filters by status code;
-s FAfor failures,-s RUfor running,-s PEfor PEND_MACH. - Never run
autorep -J % -dwithout filtering — output is massive. Use-sand specific job patterns.
⚠ Common Mistakes to Avoid
Interview Questions on This Topic
- QWhat is the autorep command used for in AutoSys?JuniorReveal
- QWhat does the -q flag do in autorep?JuniorReveal
- QHow do you list all jobs currently in FAILURE status?JuniorReveal
- QHow do you see the previous run's details for an AutoSys job?Mid-levelReveal
- QWhat wildcard does autorep use for matching job names?JuniorReveal
Frequently Asked Questions
What is autorep in AutoSys?
autorep is the AutoSys command-line tool for reporting on job status, viewing job definitions, and checking machine status. It's the primary monitoring tool for AutoSys administrators.
How do I see all AutoSys jobs in FAILURE status?
Use autorep -J % -s FA. The -s flag filters by status code (FA = FAILURE, RU = RUNNING, SU = SUCCESS, PE = PEND_MACH, OH = ON_HOLD).
What does autorep -J jobname -q do?
The -q flag outputs the job definition in JIL format — exactly as it would look if you were writing it in a JIL script. This is used to back up job definitions, create templates, and audit what attributes are currently set.
How do I check what an AutoSys job looked like in its previous run?
Use autorep -J jobname -run 1 to see the previous run, autorep -J jobname -run 2 for the run before that, and so on. Combine with -d for detailed view including exit code and runtime.
What is the wildcard character in autorep?
The percent sign % is the wildcard in AutoSys commands. autorep -J % returns all jobs. autorep -J eod_% returns all jobs starting with 'eod_'. This is consistent across AutoSys commands.
Why is autorep -J % slow in large environments?
autorep queries the Event Server database (AE_EVENTS, AE_JOBS tables). In environments with 10,000+ jobs and millions of event records, the query can take 5-10 seconds. Use -s FA to filter at the database level using indexes, which is much faster. Also regularly purge old events with db_purge_events.
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.