Autosys Quick Reference

Introduction to Autosys:

AutoSys is an automated job control system for scheduling, monitoring, and reporting. These jobs can reside on any AutoSys-configured machine that is attached to a network. An AutoSys job is any single command, executable, script, or Windows batch file. Each AutoSys job definition contains a variety of qualifying attributes, including the conditions specifying when and where a job should be run.

Defining Jobs :

There are the two methods you can use to create job definitions:

¦ Using the AutoSys Graphical User Interface (GUI).

¦ Using the AutoSys Job Information Language (JIL) through a command-line interface.

Autosys Jobs:

Job Types and Structure :

There are three types of jobs: command, file watcher, and box.

As their names imply, command jobs execute commands, box jobs are containers that hold other jobs (including other boxes), and file watcher jobs watch for the arrival of a specified file.

In the AutoSys environment, the box job (or box) is a container of other jobs. A box job can be used to organize and control process flow. The box itself performs no actions, although it can trigger other jobs to run. An important feature of this type of job is that boxes can be put inside of other boxes.

Default Box Job Behavior:

Some important rules to remember about boxes are:

Jobs run only once per box execution.

Jobs in a box will start only if the box itself is running.

As long as any job in a box is running, the box remains in RUNNING state; the box cannot complete until all jobs have run.

By default, a box will return a status of SUCCESS only when all the jobs in the box have run and the status of all the jobs is "success.

By default, a box will return a status of FAILURE only when all jobs in the box have run and the status of one or more of the jobs is "failure."

Unless otherwise specified, a box will run indefinitely until it reaches a status of SUCCESS or FAILURE.

Changing the state of a box to INACTIVE (via the sendevent command) changes the state of all the jobs in the box to INACTIVE.

Job States and Status :

AutoSys keeps track of the current state, or status, of every job. The value of a job’s status is used to determine when to start other jobs that are dependent on the job. The job status is displayed in the job report generated by the autorep command, and in the job report you can view in the Job Activity Console

Following are the status of Autosys jobs:

INACTIVE : The job has not yet been processed. Either the job has never been run, or its status was intentionally altered to “turn off” its previous completion status.

ACTIVATED :The top-level box that this job is in is now in the RUNNING state, but the job itself has not started yet.

STARTING : The event processor has initiated the start job procedure with the Remote Agent.

RUNNING : The job is running. If the job is a box job, this value simply means that the jobs within the box may be started (other conditions permitting). If it is a command or file watcher job, the value means that the process is actually running on the remote machine.

SUCCESS : The job exited with an exit code equal to or less than the “maximum exit code for success.” By default, only the exit code “0” is interpreted as “success.” If the job is a box job, this value means that all the jobs within the box have finished with the status SUCCESS (the default), or the “Exit Condition for Box Success” evaluated to true

FAILURE : The job exited with an exit code greater than the “maximum exit code for success.” By default, any number greater than zero is interpreted as “failure.” AutoSys issues an alarm if a job fails

TERMINATED : The job terminated while in the RUNNING state. A job can be terminated if a user sends a KILLJOB event or if it was defined to terminate if the box it is in failed. If the job itself fails, it has a FAILURE status, not a TERMINATED status. A job may also be terminated if it has exceeded the maximum run time (term_run_time attribute, if one was specified for the job), or if it was killed from the command line through a UNIX kill command. AutoSys issues an alarm if a job is terminated.

RESTART : The job was unable to start due to hardware or application problems, and has been scheduled to restart.

QUE_WAIT : The job can logically run (that is, all the starting conditions have been met), but there are not enough machine resources available.

ON_HOLD : This job is on hold and will not be run until it receives the JOB_OFF_HOLD event.

ON_ICE : This job is removed from all conditions and logic, but is still defined to AutoSys. Operationally, this condition is like deactivating the job. It will remain on ice until it receives the JOB_OFF_ICE event.

The difference between "on hold" and "on ice" is that when an "on hold" job is taken off hold, if its starting conditions are already satisfied, it will be scheduled to run, and it will run. On the other hand, if an "on ice" job is taken "off ice," it will not start, even if its starting conditions are already satisfied. This job will not run until its starting conditions reoccur.

The other major distinction is that jobs downstream from the job that is "on ice" will run as though the job succeeded. Whereas, all dependent jobs do not run when a job is on "on hold"—nothing downstream from this job will run.

Starting Parameters :

AutoSys determines whether to start or not to start a job based on the evaluation of the starting conditions (or starting parameters) defined for the job. These conditions can be one or more of the following:

¦ Date and time scheduling parameters are met (it is or has passed the specified date and time).

¦ Starting Conditions specified in the job definition evaluate to true.

¦ For jobs in a box, the box must be in the RUNNING state.

¦ The current status of the job is not ON_HOLD or ON_ICE.

Every time an event changes any of the above conditions, AutoSys finds all the jobs that may be affected by this change, and determines whether or not to start them.

sample jil code / Writing jil code:

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.

Here is a sample job which will verify a particular process is running or not.

/* —————– SAP_UAT_MU03_C —————– */

insert_job: SAP_UAT_MU03_C job_type: c

command: /local/SAP/processCheckUAT.sh

machine: MU03-UAT

owner: admin@MU03-UAT

permission: gx,wx,mx,me

days_of_week: all

start_times: “15:00, 14:00″

description: “Job used for Run testing of process”

alarm_if_fail: 1

max_exit_success: 1

To Insert a new JIL code :

issue command "jil"

bash-3.00$ jiljil>>1>

"The following prompt will appear" copy paste the jil code u have made example of jil code below...........

At the end the "C" or "B" determines if the job is box job or child job.

if the jil is inserted properly successfull message will come if any errors are there the jil code contains some errors..

if successfull exit;

Using Autorep command:

Function

Reports information about a job, jobs within boxes, machines, and machine status. Also reports information about job overrides and global variables.

Syntax

autorep {-J job_name -M machine_name -G global_name} [-s -d -q -o over_num] [-r run_num]

autorep -J (job name here)

This will display a list of jobs with complete details with box/jobname, last/latest run date & time, status, exit code, etc.

Viewing JIL code for any Autosys job

autorep -J (job name here) -q

To obtain the underlying JIL (Job Interaction Language) source code for any Autosys job, run command:

To obtain the information of previous runs

autorep -J (job name here) -r (No of runs back) example : autorep -J (job name here) -r 1

would generate a report for the job run one runs back

Status Abbreviations

The following table lists the abbreviations used in the ST (status) column of the autorep report, and gives the status for each abbreviation.

AC - ACTIVATED

FA - FAILURE

IN - INACTIVE

OH - ON_HOLD

OI - ON_ICE

QU - QUE_WAIT

RE - RESTART

RU - RUNNING

ST - STARTING

SU - SUCCESS

TE - TERMINATED

sendevent:

sendevents to AutoSys for a variety of purposes, including starting or stopping AutoSys jobs, stopping the Event processor, and putting a job on hold. This command is also used to set AutoSys global variables or cancel a scheduled event.

sendevent is normally used with "-E" & -J option

-J job_name : Specifies the name of the job to which the specified event should be sent. This option is required for all events except STOP_DEMON, COMMENT, ALARM, or SET_GLOBAL

-E event :Specifies the event to be sent. This option is required. Any one of the following events may be specified:

STARTJOB

KILLJOB

DELETEJOB

FORCE_STARTJOB

JOB_ON_ICE

JOB_OFF_ICE

JOB_ON_HOLD

JOB_OFF_HOLD

CHANGE_STATUS

STOP_DEMON

CHANGE_PRIORITY

COMMENT

ALARM

SET_GLOBAL

SEND_SIGNAL

Following are the example of sendevent command frequently used.

To start or force start a job manually using sendevent :

sendevent –E FORCE_STARTJOB -J "Job Name Here"

sendevent -E STARTJOB -J "Job Name Here"

To put jobs on OFF ICE or ON ICE :

sendevent -E OFF_ICE -J "Job Name Here"

sendevent -E ON_ICE -J "Job Name Here"

autostatus: Reports the current status of a specific job, or the value of an AutoSys global variable. Ex: autostatus -J job_name, -S instance

From:

http://autosys-tutorials.blogspot.com/2011/04/autosys-quick-reference.html

Autosys 快速参考的更多相关文章

  1. Oracle安装部署,版本升级,应用补丁快速参考

    一.Oracle安装部署 1.1 单机环境 1.2 Oracle RAC环境 1.3 Oracle DataGuard环境 1.4 主机双机 1.5 客户端部署 二.Oracle版本升级 2.1 单机 ...

  2. Oracle 11.2.0.4单实例打PSU,OJVM PSU补丁快速参考

    写在前面: 1.Oracel打每个补丁的操作有时存在差异,所以不管多熟悉,都应该在打任何补丁之前阅读新补丁中附带的readme. 2.Oracle每季度都会更新一个最新的PSU,本文最新指的是当前最新 ...

  3. Oracle 11.2.0.4 DataGuard 环境打PSU,OJVM PSU补丁快速参考

    环境:RHEL6.5 + Oracle 11.2.0.4 DataGuard physical standby 主库和备库都是单节点. 需求:主备库同时应用160719的PSU和OJVM PSU补丁. ...

  4. 数据库 PSU,SPU(CPU),Bundle Patches 和 Patchsets 补丁号码快速参考 (文档 ID 1922396.1)

    数据库 PSU,SPU(CPU),Bundle Patches 和 Patchsets 补丁号码快速参考 (文档 ID 1922396.1)

  5. jenkins2 pipeline 语法快速参考

    jenkins2 pipeline中常用的语法快速参考. 文章来自:http://www.ciandcd.com文中的代码来自可以从github下载: https://github.com/ciand ...

  6. oracle数据库 PSU,SPU(CPU),Bundle Patches 和 Patchsets 补丁号码快速参考 (文档 ID 1922396.1)

    数据库 PSU,SPU(CPU),Bundle Patches 和 Patchsets 补丁号码快速参考 (文档 ID 1922396.1) 文档内容   用途   详细信息   Patchsets ...

  7. Razor 语法快速参考

    Razor 语法快速参考   本文引自:http://haacked.com/archive/2011/01/06/razor-syntax-quick-reference.aspx 语法名称 Raz ...

  8. 转: seajs手册与文档之 -- 快速参考 ( ~~useful )

    目录 快速参考 seajs.use seajs.config define require require.async exports module.exports 快速参考 该页面列举了 SeaJS ...

  9. Selenium 2.0 WebDriver 自动化测试 使用教程 实例教程 API快速参考

    Selenium 2.0 WebDriver 自动化测试 使用教程 实例教程 API快速参考 //System.setProperty("webdriver.firefox.bin" ...

随机推荐

  1. Mongodb集群调研

    目录 一.高可用集群的解决方案 二.MongoDB的高可用集群配置 三.Mongo集群实现高可用方式详解 四.Sharding分片技术 一.高可用集群的解决方案 高可用性即HA(High Availa ...

  2. Nginx配置缓存

    目录 一.简介 二.配置 三.其它参数 忽略Cache-Control头部 缓存post请求 缓存动态内容 使用Cookie作为缓存键的一部分 手动清理缓存 支持断点续传 设置查看缓存命中与否 一.简 ...

  3. 转:Android控件属性

    Android功能强大,界面华丽,但是众多的布局属性就害苦了开发者,下面这篇文章结合了网上不少资料,花费本人一个下午搞出来的,希望对其他人有用. 第一类:属性值为true或false android: ...

  4. CF158A Next Round 题解

    Content 有 \(n\) 个人参加比赛,第 \(i\) 名在第一轮的分数是 \(a_i\)(保证 \(a_i\geqslant a_{i+1}\))已知下一轮预计能进 \(k\) 人,当然如果有 ...

  5. CentOS7下使用NFS文件共享给Window server 2012

    CentOS7下使用NFS文件共享给Window server 2012 2018年08月24日 23:15:54 疼迅扣扣 阅读数:443  出自https://blog.csdn.net/u013 ...

  6. DevOps实战(Docker+Jenkins+Git)

    基于Docker+Jenkins+Git的CI/CD实战 与上一篇随笔:基于 Jenkins+Docker+Git 的CI流程初探 有所不同,该内容更偏向于实际业务的基础需求. 有几点需要注意: 该实 ...

  7. c++使用map保存成员函数地址

    note 本基于c++11介绍一种使用map保存成员函数地址 可避免使用 if 和 switch 配置灵活 方便, 代码维护效率高 结果: 范例开始 头文件包含 #include <iostre ...

  8. VS c/c++常用配置项

    VS2015 下面的配置,Vs是通用的 自己常用VS2015, 但其默认的一些设置不能满足我的日常. 比较熟悉c/c++, 以下配置仅适用c/c++ 设置方法: 工具-选项-文本编辑器-c/c++ 常 ...

  9. 【LeetCode】1013. Pairs of Songs With Total Durations Divisible by 60 解题报告(Python)

    作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 日期 题目地址:https://leetcode.c ...

  10. 【LeetCode】518. Coin Change 2 解题报告(Python)

    [LeetCode]518. Coin Change 2 解题报告(Python) 作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 题目 ...