AutoSys autorep — Filtering 10K Jobs With -s FA
3 failed x_ prefixed jobs hid mid-scroll in 10,000 lines of alphabetical autorep output.
- 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.
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.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.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.
That's AutoSys. Mark it forged?
3 min read · try the examples if you haven't