3 AutoSys Tutorial
3 AutoSys Tutorial
AutoSys is used for defining, scheduling and monitoring jobs. These jobs can be a UNIX script, java
program or any other program which can be invoked from shell. Before starting we assume that user has
already setup an AutoSys environment. This environment consists of autosys server and autosys client.
There are various parameters to define autosys job. Starting from profile, timezone, start time, starting
condition and so on. There are the two methods you can use to create job definitions:
1. Using the AutoSys Graphical User Interface (GUI).
2. Using the AutoSys Job Information Language (JIL) through a command-line interface.
JIL stands for Job Information Language. Using this you can instruct autosys to save job definitions. This
information saved in autosys database. You can also create a jil file which contains job definition. You
can then pass this jil file to autosys. Essential attributes for defining job
1. Job Name JIL Keyword : insert_job. Name used to identify the job.
2. Job Type a. JIL Keyword : job_type. The job type is one of job types: command (c), file watcher (f)
or box (b).
Command Job: Script/Batch that has to execute to perform certain activity.
File Watcher Job: Which is used to watch the file on a server in a path.
Box Job : Collection of FW & command job.
3. Owner a. JIL Keyword : owner The job owner specifies whose user ID the command will be run
under on the client machine. This attribute is automatically set to the user who invoked jil or the GUI to
define the job, and cannot be changed except by the edit superuser.
machine:unixMachine
owner:username
1. Event Server:
The event server is a AutoSys database which stores all system information and events as well as all job,
monitor, and report definitions. Sometimes this database is also called as a data server, which actually
describes a server instance. That is, it is either a UNIX or Windows process, and it is associated data
space (or raw disk storage), that can include multiple databases or tablespaces.
2. Event Processor:
This is main component of the autosys system. This processes all the events it reads from dataserver. The
event processor is the program, running either as a UNIX process or as a Windows service that actually
runs AutoSys. It schedules and starts jobs. When you start the event processor it continually scans the
database for events to be processed. When it finds one, it checks whether the event satisfies the starting
conditions for any job in the database. [ad#blogs_content_inbetween]
3. Remote Agent:
On a UNIX machine, the remote agent is a temporary process started by the event processor to perform a
specific task on a remote (client) machine. On a Windows machine, the remote agent is a Windows
service running on a remote (client) machine that is directed by the event processor to perform specific
tasks. The remote agent starts the command specified for a given job, sends running and completion
information about a task to the event server, then exits. If the remote agent is unable to transfer the
information, it waits and tries again until it can successfully communicate with the database.
Explanation: 1. The event processor scans the event server for the next event to process. If no event is
ready, the event processor scans again in five seconds.
2. The event processor reads from the event server that an event is ready. If the event is a STARTJOB
event, the job definition and attributes are retrieved from the Event Server, including the command and
the pointer (full path name on the client machine) to the profile file to be used for the job. In addition, for
jobs running on Windows machines, the event processor retrieves from the database the user IDs and
passwords required to run the job on the client machine.
3. The event processor processes the event. If the event is a STARTJOB, the event processor attempts to
establish a connection with the remote agent on the client machine, and passes the job attributes to the
client machine. The event processor sends a CHANGE_STATUS event marking in the event server that
the job is in STARTING state.
Below is the diagram which explains the basic functionality, please check the explanation.
4. On a UNIX machine, the inetd invokes the remote agent. On a Windows machine, the remote agent
logs onto the machine as the user defined as the job’s owner, using the user IDs and passwords passed to
it from the event processor.
5. The remote agent sends an acknowledgment back to the event processor indicating that it has received
the job parameters. The socket connection is terminated. At this point, the event processor resumes
scanning the event server database, looking for events to process.
6. The remote agent starts a process and executes the command in the job definition.
7. The remote agent issues a CHANGE_STATUS event marking in the event server that the job is in
RUNNING state.
8. The client job process runs to completion, then returns an exit code to the remote agent and quits.
[ad#blogs_content_inbetween]
RU RUNNING Running
ST STARTING Starting
SU SUCCESS Success
FA FAILURE Failure
TE TERMINATED Terminated
OI ON_ICE On Ice
IN INACTIVE Inactive
AC ACTIVATED Activated
RE RESTART Restart
OH ON_HOLD On Hold
RD Refresh Dependencies
RF Refresh Filewatcher
Interview Questions:
a. When we put a job from ON ICE to OFF ICE job will go to INACTIVE status
When we put a job from ON HOLD to OFF HOLD job will go to ACTIVE status.
b. When an ON_HOLD job is put off hold, it runs, if it's starting conditions are satisfied, while
an ON ICE job will not run, after putting into OFF ICE, even if it's starting conditions are
met.
c. Dependency : When we put a failed dependent job in ON ICE next succeeding jobs will run
without any issue where are in ON HOLD case next succeeding jobs will not run until the job
get success.
job_name
job_type
command
standard_output
standard_error
Job_name
Job_type
File_to_watch
Job_name
Job_type
7. What you will do when job failed due to data length/Data quality issues.
A. Delete the corrupted/ culprit record from the batch feed file and reprocess it by force starting the
autosys job.
8. How to change the status of the Job from command line?
A. We can change the status of the job by using the below command
Sendevent -E <EventName> -J <Job Name>
<Event Name > START or FORCESTART or KILL or ONHOLD or ONICE or OFFICE or
OFFHOLD
<Job Name > Name of the job
9. What is Upstream?