AutoSys Scheduler: Create & Manage Jobs using AutoSys Job Scheduler

autosys
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

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.

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.

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.

Basic functionality of AutoSys

Below is the diagram which explains the basic functionality, please check the explanation.
functional-diagram-autosys

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

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"

Meaning of AutoSys status

STATUSAUTOSTATUSMeaning
RURUNNINGRunning
STSTARTINGStarting
SUSUCCESSSuccess
FAFAILUREFailure
TETERMINATEDTerminated
OION_ICEOn Ice
ININACTIVEInactive
ACACTIVATEDActivated
RERESTARTRestart
OHON_HOLDOn Hold
QWQUE_WAITQueue Wait
RDRefreshDependencies
RFRefreshFilewatcher

Reference

http://supportconnectw.ca.com/public/autosys/infodocs/autosys_cheatsheet.asp



83 Comments

  • Tinshuk Singh 25 April, 2013, 13:30

    Is it possible to define time for a job which is inside the box for which time has already defined ? for eg.
    suppose there is a box Box1 which has run time defined as 10:00 and contains two jobs job1 and job2, consider if time for job2 has defined as 12:00.
    can we do like this ?
    if yes then what will be expected behavior?

    • Laxman 17 July, 2013, 18:23

      We could, but such case we create one more Box with job2 runs at 12:00 clock instead of keeping same box

    • neha 8 July, 2014, 23:05

      Hi Tinshuk Singh ,

      The Box 1 will kick OFF at 10:00 & the jobs inside the box will wait until its conditions are meet , the job2 will kick off at 12:00

  • Naresh 21 June, 2013, 9:42

    Can we able to hold all the job in autosys in the same time.. if yes can u explain how..

    • Laxman 19 July, 2013, 12:08

      We can HOLD or OFF hold all jobs same time, To hold it you need to create one sendevent job and test file which conatain all jobs with sendevent command.

  • ABCD 8 July, 2013, 16:53

    hi guys

  • Urvashi 8 August, 2013, 22:18

    Has anyone worked on job dependencies across instances? The one in which we use the caps char “^” to define a condition if a job has dependency on another job in a different instance? Need some help on it.

    Job A on Instance X
    Job B on instance Y
    Condition on job A: s(B^Y)
    Need some info on this

  • Shubh 23 September, 2013, 15:13

    Hi Urvashi,

    Job A on Instance X
    Job B on instance Y
    Condition on job A: s(B^Y)

    The above condition is absolutely correct. Please let me know what query do you have..

    Thanks

  • sushanth 26 September, 2013, 0:49

    Can we have a condition like ‘not running’ in autosys job
    I have a requirement –> in one of the job the condition should be if previous job doesn’t run at 7pm, then run the present job.

  • K.Vasanth 27 September, 2013, 9:39

    Hi,

    Can some one say how to extract active Jobs email id? I know it can be sone through extracting JIL and from there. Is there anyway it can be done directly?

  • newbie 29 September, 2013, 19:50

    Hi

    I get the following error:
    CHASE 09/29/2013 04:13:07 0 PD 09/29/2013 04:13:15

    I have checked the remote agent process and its up and running, I also issued a autosttaus command to see whats the status of the job in the eventsystem,

    can some one please explain why this error occurs and how to fix it.
    I’d appreciate a detail explaination.

    thanks

  • newbie 30 September, 2013, 5:44

    Hi

    I get the following error:
    CHASE 09/29/2013 04:13:07 0 PD 09/29/2013 04:13:15

    I have checked the remote agent process and its up and running, I also issued an autostatus command to see whats the status of the job in the eventsystem,

    can some one please explain why this error occurs and how to fix it.
    I’d appreciate a detail explaination.
    Also,would like to know how to start a remote agent. I mean,do we need to have a process running on the remote machine where the actual shell script is executed ?

    thanks

  • Sowmya 21 November, 2013, 9:45

    Can we put all the jobs in a box ONICE by just giving the Box name?

  • Raj Patel 22 November, 2013, 20:36

    Viral,

    What are best practice server component requirements (CPU, RAM, disk space, etc) we would need to build to efficiently run 5000 simultaneous jobs?

    Raj

  • Confused_user 25 November, 2013, 20:17

    If it possible to set a starting condition below

    RU(JobA) & S(JobB)

    SO basically i want a job to trigger if and only if job A is still in Running and job B is in success

  • Sneha 1 December, 2013, 18:27

    Hi,

    I have defined box B1 which has two jobs J1 and J2. If I force start the box B1, the job J1 didn’t run. Both the job status just changed to Activated. But if I force the jobs individual, the job runs successfully. Can anyone please tell me is this because of any configure issue in JIL and which attribute must be included.

    • SamsHaja 3 December, 2013, 20:38

      Hi Sneha,

      you shouldn’t put any starting time condition like “start_times:” for job “J1″ inside the box “B1″

      ex:
      JIL for box:

      job_name: B1
      job_type: b
      date_condision: 1
      days_of_week: all
      start_times: “10:00″
      timezone: India

      JIL for job J1

      job_name: J1
      job_type: c
      box_name: B1
      command: sleep 100
      permission: wx, mx
      owner: haja
      machine: localhost
      timezone: India

      JIL for job J2

      job_name: J2
      job_type: c
      box_name: B1
      command: sleep 100
      permission: wx, mx
      conditiond: s(J1)
      owner: haja
      machine: localhost
      timezone: India

      • Sneha 4 March, 2014, 9:03

        Thanks, that helped :)

  • Arun 7 December, 2013, 22:00

    Hi,

    We don’t have access to autosys server and we have only GUI access.
    i wanted to know how to create JIL file in autosys server

  • Pradhan 23 January, 2014, 23:05

    Need to know if there are classes held for autosys as me and my team would like to learn about autosys, job scheduling and agent installation. So let me know more about it

  • VIPIN KUmAR 1 February, 2014, 0:37

    Do we have any simulator for autosys, so that we can practise at home…
    it will be very helpful for me to create jil and do r n d on that…

    Thanks in advanced…

  • Srinivas Jami 10 February, 2014, 16:06

    Hi Viral,
    I have a requirement to migrate Windows & Unix jobs to Autosys. May I know the process and steps to implement this migration?

  • Kumar 14 February, 2014, 16:50

    We are running a web URL using the autosys jobs. Now we are getting always the success state even though we got errors in the application.

    How can we assign the return code from web application to the autosys job exit code ?

    Am a newbie and didn’t done through the documentation much..

    Any inputs highly appreciated..

  • Sneha 4 March, 2014, 9:04

    Hi,

    Is there a way to add a new calendar date using JIL?

  • Vasu 31 March, 2014, 16:30

    Hi,

    Is it possible to assign or submit multiple jobs to the multiple instances of remote agent running on client server?

    Rgds,
    Vasu.

  • Shivam 1 April, 2014, 17:36

    Is there any command to check any jobs scheduled date/time?

  • sowmya 8 May, 2014, 14:44

    Can I use a sendevent command to change a RUNNING filewatcher job to INACTIVE. Will it have an issues at the backgroud?

  • diana tavolario 9 May, 2014, 23:53

    If a job is in a RUNNING status, if it is put ON ICE, will the job complete then go into the on-ice status? Also, if the job is a .bat file and runs on another machine… so autosys shows status of SUCCESS, but the job is still running on another server, if put on ice at that point, will job in background continue running?

  • Venu 14 May, 2014, 16:13

    Hello All,
    I am a new bee in DEVOPS. I have limited knowldge about autosys. I am looking at automating the job to put on ON ICE, ON OFF state from an external tool which is runnng on unix m/c. I came to know there is a JIL language to do this. can any one help me how to script this and test ? It would be great if there is any sample code for this.

    Thanks in advance.

  • Jaya 2 June, 2014, 6:19

    Hi, I am a beginner and keen to learn Autosys, Could you pls guide me where should I practice Autosys commands? Is there a unix or windows server for practice?

  • Vechoorian 20 August, 2014, 11:44

    Hi,

    can any one help me to launch autosys GUI from unix server

  • Toroop 12 October, 2014, 21:08

    Where to download autosys software from .

Leave a Reply

Your email address will not be published. Required fields are marked *

Note

To post source code in comment, use [code language] [/code] tag, for example:

  • [code java] Java source code here [/code]
  • [code html] HTML here [/code]

Current ye@r *