Monday 29 May 2017

AutoSys Scheduler: Create and Manage Jobs

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.

AutoSys System components:

1. Event server (AutoSys database)
2. Event processor
3. Remote agent


AutoSys Functionality:


Defining Autosys job

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.

In this tutorial we will use JIL language to create autosys jobs.

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).
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.

Other job attributes:

1. command: The command attribute can be the name of any command, executable, UNIX shell script or batch file, and its arguments.
2. machine: This attribute specifies the client machine on which the command should be run.
3. date_condition: The start date/time dependencies attribute is a toggle, which specifies whether or not there are date, time, or both, conditions required for starting the job.
4. days_of_week: The days of the week attribute specifies the days on which the job should be run.

Sample jil file for command job echoJob.jil

insert_job:echoJob
machine:unixMachine
owner:username
command:echo "Hello this is command job"

To add this job in atosys db. Run following command from unix:

jil < echoJob.jil

This command will add "echoJob" job to autosys databse.

Commands to control the job

Start job command

sendevent –E FORCE_STARTJOB -J <job_name>

sendevent -E STARTJOB -J <job_name>

To put jobs on OFF ICE or ON ICE


sendevent -E OFF_ICE -J <job_name>

sendevent -E ON_ICE -J <job_name>

sendevent -E KILLJOB –J "Job Name Here"-- 


Thanks,
Srinivasan G

2 comments: