Autosys - A beginners guide

AUTOSYS is a batch job scheduler and orchestration tool. It is used to execute batch jobs in a timely and organized fashion.

To configure a batch in AUTOSYS , one needs to create a ".jil" file. 

How to structure a JIL file

Before creating your job in AUTOSYS, one should be very clear on 
a. The command and hostname of unix machine for invoking batch process.
b. Whether its a standalone job or is part of a series of jobs.
c. Timings and Calendar considerations.
d. If there is a maximum time associated with job.
e. Bash profile to be used when invoking on unix or Linux system.
f. Trigger conditions for the job.
g. Timezone considerations if multiple regions are involved.

First command in JIL instructs as to what are we trying to do. There are 3 actions here:
1. insert_job : <job name>
2. update_job : <job name>
3. delete_job : <job name>

The other JIL attributes are as explained below:
job type. There are again 3 types used:
1. job_type : b (BOX)
2. job_type : c (CMD)
3. job_type : f (File watcher)

command : <an executable command>

machine : <host machine or server where command should run>

owner : <the job owner or sudo user id under which command is to be run>

permission : The notations used here are gx , ge , mx etc. 
The first letter is one among g , w and m
g - group
w - world
m - authorized user

The second letter signifies the rights which can be as :
x - execute
e - edit

date_conditions : 0 or 1
0 would imply that this job would run based on parent or box job timing conditions . 1 means that there is a start time indicated here in this JIL.

condition : refers to the trigger condition that should be used to trigger this job

max_run_alarm : Time configured in minutes to indicate that job has overrun its usual time.

term_run_time : Time in minutes after which AUTOSYS will kill the job.

timezone : Will specify the timezone in which the job needs to run. 

profile : bash profile to be used to setup the parameters on client unix machine. This would relate to setting up paths that are necessary to run this job.


Once the JIL file is ready, it can be executed on the respective AUTOSYS machine to create a new job in AUTOSYS.

jil < <name of JIL file>

Quick commands for checking job status on unix machine

The commands below will only run on the unix machine which hosts the AUTOSYS or has a connection to directly interact with server on which AUTOSYS is hosted.

To check the status of current job

autorep -J <job name> 

To display status of previous job run

autorep -J <job name> -r <number of look back runs>


Commands to control AUTOSYS job execution


General syntax is :
sendevent -E <action> -J <jobname>

The actions can be one among below:
STARTJOB
KILLJOB
DELETEJOB
FORCE_STARTJOB
JOB_ON_ICE
JOB_OFF_ICE
JOB_ON_HOLD
JOB_OFF_HOLD

To change status of a job to success or inactive , below command would be used.

sendevent -j <job name> -E CHANGE_STATUS -S <status>

Where status can be one of
SUCCESS
FAILED
INACTIVE

Comments

Popular posts from this blog

Spring Quartz scheduler

Linux file and directory listing - ls command