Untitled Document
autosys Command

The autosys command is use for Job scheduling , Sometimes we want a program or a job to be run on specified time without any human intervation . Like if i want to run the daily Database backup program everyday at morning 1 am , it merely impossible for a person to run this job manually in early morning the best option is to put such jobs in autosys . To create an autosys job we need to write a jil file which contains details like - machine on which job to be run , time , comamnd to be run , permission , etc .. The basic Jil file syntax is as follows .

   insert_job: template job_type: c
box_name: box1
command: ls -l
machine: localhost
owner: lyota01@TANT-A01
permission: gx,ge,wx,we,mx,me
date_conditions: 1
days_of_week: all
start_times: “15:00, 14:00″
run_window: “14:00 - 6:00″
condition: s (job1)
description: “description field”
n_retrys: 12
term_run_time: 60
box_terminator: 1
job_terminator: 1
std_out_file: /tmp/std_out
std_err_file: /tmp/std_err
min_run_alarm: 5
max_run_alarm: 10
alarm_if_fail: 1
profile: /tmp/.profile

Explanation of each line:

  Insert_job: this will let the autosys server to recognize the job and inserts into autosys DataBase. 
  Jobtype: there are two types of jobs namely box and child ( c=child, box)
  box_name: this is the box job name: box job can have more than 1 child jobs. (this is just like grouping the jobs).
  commands: this is where you tell autosys, what to do when the job runs. ( you’ll give reference to your scripts here).
  machine: name of the machine where you want to run the job.
  owner: owner of the job.
  permissions.
  date_conditions: 1 if you have any specifications.
  days_of_week: on which days of the week you want the job to run.
  start_time: the time at which the job should kick-off.
  run_window: this option is for monitoring jobs. the job will run continously for the specified time window.
  conditions: here you can specify the dependencies. like success of some other job.
  description.
  n_retrys: no of retrys on a failure.
  term_run_job: the job will terminate if it runs for specified time.
  box_terminator: if 1, terminates box job depends on term_run_time.
  job_terminator: if 1, terminates child job depends on term_run_time.
  std_out_file: standard output file (log) for the job
  std_err_file: Error log file if the job fails
  min_run_alarm: if the job terminates/completed with in that time it generate an alarm
  max_run_alarm: if the job runs for more than the specified time, it generate an alarm
  alarm_if_fail: generates an alarm if the job fails
  profile: the file where you can keep all your variables (variable names)
We don’t use all the above options in all the jobs, it depends on the requirements.

Sample jil file for echo command job -

Copy the below jil file code and paste in your new jil file and save it as eho.job.jil

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

This will create a file called eho.job.jil.

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

This command will add “echoJob” job to autosys databse.

   jil < echoJob.jil

How To update existing job in atosys db.

It may happen that over a perisod of time , we may need to change certain parameters of ou autosys job, like - machine on which job name , time or day of week . Just make the changes in your jil file and instead of insert use update command and save your file .

   update_job:echoJob
Untitled Document