AutoSys autorep — Filtering 10K Jobs With -s FA
3 failed x_ prefixed jobs hid mid-scroll in 10,000 lines of alphabetical autorep output.
20+ years shipping production infrastructure and CI/CD at scale. Notes here come from systems that actually shipped.
- 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 is like the 'check status' button on a delivery tracking website. You tell it which jobs you want to track (by name or pattern), and it tells you what's happening — whether they're running, succeeded, failed, or waiting.
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.
How AutoSys autorep -s FA Filters 10K Jobs Without Crashing
The autorep command in AutoSys is the primary interface for querying job definitions and statuses from the AutoSys database. The -s FA flag filters the report to show only jobs with a status of 'FAILURE' — meaning jobs that have terminated abnormally. This is not a live poll; autorep reads from the Event Server's database, which stores the last known status for each job. For a system managing 10,000+ jobs, autorep -s FA returns only the subset of jobs that failed, typically 1-5% of total jobs, making it efficient for daily operations. The command queries the database using a WHERE clause on the status column, so performance depends on database indexing. In practice, autorep -s FA is used in monitoring scripts and dashboards to quickly identify failed jobs without parsing the entire job stream. It's the go-to command for operations teams during shift handovers to assess system health — a single command can surface 50 failed jobs out of 10,000 in under a second, provided the database is tuned.
Basic autorep usage
The most common use is checking the status of one or more jobs.
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.
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.
-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.Why `-L` Flagging Is the Only Way to Audit Historical Runs
Your ops director wants to know why a job reran three times last Thursday. autorep -d shows you current status. Useless. You need the run history. That's the -L flag. It dumps the job's log file path, start/end times, and exit codes for every execution in the retention window.
Run autorep -L JOB_WEBHOOK_INGEST -r and you get the last N runs. No GUI. No database query. Five seconds. The -r flag filters to recent runs only — critical when your log retention is 30 days and the job runs hourly. Without it, you're reading 720 entries.
The output isn't pretty. It's raw, tabular, and exactly what a debugger needs. Exit code 12 across three consecutive runs? That's a file lock. Exit code 127 on the fourth? Missing binary. You can trace failure cascades without opening a single log file.
Senior shortcut: alias this in your .bashrc as jobhist and force your juniors to use it before escalating to you.
-r, -L dumps every retained run — could be 10,000+ lines for high-frequency jobs. Always use -r -N to limit output to N recent runs. Your terminal will thank you.-L -r -5 to see the last five runs before you touch a job.The `-w` Flag: Why You Don't Play Whack-a-Mole With Alerts
You've got 200 jobs. Three are on hold. Two are running late. One failed at midnight. autorep -w gives you a single line per job with status alone. No headers. No frame. Just the state machine.
Filter it with grep -E 'FA|TE|SU' and you see failures, terminations, and successes in one glance. No scrolling. No grep through a wall of JIL.
The real win? You can put this in a cron job. Every 5 minutes, run autorep -w JOB_GROUP_PROD | mail -s 'Autosys Pulse' ops-team@corp.com. That's your zero-config alerting. No Splunk. No PagerDuty. Just text.
Downside: -w doesn't show exit codes. You still need -d for that. But for a heartbeat check? It's the fastest way to know if your pipeline is haemorrhaging.
Production trick: Combine -w with -L in a shell loop. First -w finds the failing jobs. Second -L gets the logs. That's two commands to triage anything.
autorep -w JOBGROUP | awk '$2 !~ /SU|RE/{print}' to your daily cron. It emails you only non-success jobs. Five lines of shell. Zero dependencies.-w for a 50-millisecond heartbeat on your entire job forest. Pair with grep to skip the noise.The 10,000-Line autorep That Hid the Crash
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 % output is massive in large environments. Always filter with -s FA for failures, -s RU for running.
- Don't rely on visual scanning of autorep output. Use automated monitoring: script that checks for failures and alerts immediately.
- The terminal scrollback buffer is not a reliable monitoring tool. What you don't see will break your SLA.
- Build aggregation scripts:
autorep -J % -s FA | wc -lgives failure count. Alert if > 0.
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 -J % -s FAautorep -J % -s FA -d | grep -E 'Job Name|Exit Code'alias autofail='autorep -J % -s FA' in .profile. Use cron script to send email when failures detected.Key takeaways
-s FA for failures, -s RU for running, -s PE for PEND_MACH.autorep -J % -d without filtering-s and specific job patterns.Common mistakes to avoid
5 patternsRunning autorep -J % without filtering in large environment
autorep -J % -s FA for failures, -s RU for running. Create aliases: alias autofail='autorep -J % -s FA'. Use autorep -J % -s FA -d for detailed failure info.Not using -q before bulk JIL changes — losing job definitions
autorep -J % -q > backup_$(date +%Y%m%d_%H%M%S).jil. Automate daily full backup via AutoSys job. Store backups in version control (Git).Using -d without filtering — too much output
autorep -J % -d and gets 50,000 lines of output. Terminal freezes or takes minutes to complete. Worthless for real-time monitoring.autorep -J % -s FA -d for failures, or autorep -J eod_% -d for specific job family. Never run -d on all jobs.Assuming autorep output is sorted by status — it's not
-s FA to show only failures. Sort output yourself: autorep -J % | sort -k5 (sorts by status column, but unreliable). Best: rely on status filter, not visual scanning.Not checking prior runs with -run for intermittent failures
autorep -J job_name -run 1 (previous run), -run 2 (run before that). Look for patterns in exit code or runtime.Interview Questions on This Topic
What is the autorep command used for in AutoSys?
-M). It's the most frequently used command for AutoSys operators and administrators.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. Notes here come from systems that actually shipped.
That's AutoSys. Mark it forged?
3 min read · try the examples if you haven't