Home

Contact Us

Documentation

 

The Team

 

News

 

Bugs And Fixes

 

Feature Requests

 

Help Options

 

Donations

 

 

 

 

 

 

 

Job Runbooks

 

Introduction

 

Runbooks are ways of specifying how and when a job can run, and what sort of processing needs to be done before the job is launched and after it concludes. A runbook is simply an ASCII file that is related to a job via the job –runbook command. The file itself contains aliases, selectors indicating the conditions under which various sections of the runbook are to be performed, and the executable sections of the runbook.

 

Parts of Runbook File

  • User Aliases
  • Job Aliases
  • Concurrency Aliases
  • Scheduling Aliases
  • Calendar Aliases
  • Directory Aliases
  • File Aliases
  • Source Machine Aliases
  • Target Machine Aliases
  • Login Aliases
  • Logical Aliases
  • Selectors
  • Launch Rules

 

User Alias:

USER_ALIAS name = {userid|*|~}[.group|*|~][@{host|*|~}[:{HOST|VIRTUAL|REGION}]] [[+|-]…]

Examples:

USER_ALIAS admin=root-root@lab01-root@lab02-root@lab03

USER_ALIAS acct=*.acct-nobody.acct-www.acct+*.fin+*.sys+*.*@acct:REGION

 

Job Alias:

JOB_ALIAS name= [{jobname|*|~,}]{userid|*|~}[.group|*|~] [@{host|*|~}[:{HOST|VIRTUAL|REGION}]] [[+|-]…]

Examples:

JOB_ALIAS admin=root-root@lab01-root@lab02-root@lab03

JOB_ALIAS acct=*.acct-nobody.acct-www.acct+*.fin+*.sys+*.*@acct:REGION+acctjob,*.*

 

Concurrency Alias:

            CONCURRENCY_ALIAS name=[NOT ][MIN|MAX] nnn [FOR [NOT] (job_expr|job_alias)] [NOT ](condition)) [ AND|OR …]

            Where

                       

condition::={subcondition|(subcondition) {AND|OR} …}

 

subcondition::=term {{=|<|>|<>|<=|>=|matches|contains|begins|ends} term| between term,term|in term[|[…]]}

 

term::={jobinfo_expr|JOBNAME|jobq_expr|jobnum_expr|login_expr| user_expr|var_expr|nnnquoted string”|`cmdimage`}

 

jobinfo_expr::=JOBINFO [nnn|mnemonic|jcsvar]

 

jobq_expr::= JOBQINFO [nnn|mnemonic|jcsvar]

 

jobnum_expr::= JOBNUMINFO [nnn|mnemonic|jcsvar]

 

login_expr:: = LOGIN [jobname,]user[.group]

 

user_expr::= USER user[.group][@host [:{HOST|REGION|VIRTUAL}]]

 

var_expr::= variablename[%scope]

 

For the format of scope expressions, refer to the scope command.

 

Scheduling Alias:

            SCHEDULING_ALIAS name=[not] schedule_modifier [and|or …]

 

Calendar Alias:

            CALENDAR_ALIAS name=condition

 

condition::={subcondition|(subcondition) {AND|OR} …}

 

subcondition::=term {{=|<|>|<>|<=|>=|matches|contains|begins|ends} term} |between term,term|in term[|[…]]}

 

term::={date_specquoted string”|`cmdimage`|interval unit[.calendar] date_calc,date_calc}

 

date_spec::= date_calc[:format]

 

date_calc::= {date|date_increment}[{+|-}…]

 

date_increment::= count[.duration[.calendar]]

 default duration is days, and default calendar is master.

 

date::=date_string[.calendar]

The format of date_string is dependent upon the NLS calendar format specification for the calendar invoked (default is mm/dd/yyyy[@hh:mi[:ss]]])

 

 

 

Directory Alias:

            DIRECTORY_ALIAS name=directory [ …]

 

File Alias:

            FILE_ALIAS name=file [ …]

 

Source Alias:

SOURCE_ALIAS name={host_reference|ip_reference}[ …]

 

Where

 

host_reference::=[HOST:|VIRTUAL:|REGION:]targetname

 

ip_reference::={ip_addr[/{bits|netmask}|-ip_addr]

Examples:

192.168.0.0/24

192.168.1.128/255.255.255.128

192.168.1.50-192.168.1.100

192.168.1.101

 

Target Alias:

TARGET_ALIAS name={host_reference|ip_reference|hw_addr}[ …]

 

Where

 

host_reference::=[HOST:|VIRTUAL:|REGION:]targetname

 

hw_addr::=MAC:mac_address

 

ip_reference::={ip_addr[/{bits|netmask}|-ip_addr]

Examples:

192.168.0.0/24

192.168.1.128/255.255.255.128

192.168.1.50-192.168.1.100

192.168.1.101

 

 

Login Alias:

LOGIN_ALIAS name=[{jobname|*},]{user|*}[.{grp|*}][{+|-}…]

Examples:

LOGIN_ALIAS acctjobs=acct.*+fin.*+acctjob,*.*

LOGIN_ALIAS systems=root.*+*.sys+*.bin+*.dba+oracle.*

 

Logical Alias:

LOGICAL_ALIAS name=[NOT] (condition) [{AND|OR} …]

Selectors:

Introduction:

INTRODUCTION intro_action[:selection]

Conclusion:

CONCLUSION concl_action[:selection]

 

Where

 

intro_action::={LOCK| LAUNCH [-edit “sed_cmd”[ …]]| DENY “errmsg”[,errnum]| HOLD “holdmsg”| sectionname}

 

concl_action::={{ABORT|FAIL|ERR|WARN|OK} [“errmsg”[,errnum]] |sectionname}

 

launch_params::=[-trace] [job_modifier] [ …] [schedule_modifier] [ …]

 

selection::= [NOT] (subselector) [{AND|OR} …]

 

subselector::={USER {user_alias|user_spec}| JOB {job_alias|job_spec}|CONCURRENCY {concurrency_alias|concurrency_spec}| SCHEDULE {schedule_alias|schedule_spec}| CALENDAR {calendar_alias|calendar_spec}| DIRECTORY {directory_alias|directory_spec}| FILE {file_alias|file_spec}| SOURCE {source_alias|source_spec}| TARGET {target_alias|target_spec}| LOGIN {login_alias|login_spec}|LOGICAL {logical_alias|logical_spec}}

 

Introduction selectors are evaluated before the job is introduced. Conclusion selectors are evaluated after the job finishes. If a selection is true (or if no selection is provided), then the corresponding action is performed.

 

The special actions for the introduction selector are: LOCK, LAUNCH, DROP, EDIT, HOLD and DENY. LOCK indicates that the job is to be locked in the RUNBOOK state until this selection becomes false. DROP specifies launch parameters that should be removed from the job –launch command line before the job is submitted. EDIT specifies a sed command or commands that should be used to operate on the job –launch command line before the command is launched. LAUNCH specifies that the job is to be launched, with any specified parameters added to the job –launch command. HOLD indicates that a manual hold is placed on the job that must be released by system management before the job can execute. DENY specifies that the job is to be rejected for launch, and will print the error message specified to stderr.

 

The special actions for the conclusion selector are: ABORT, FAIL, ERR, WARN, OK. These correspond to the state that will be assigned to the job for its completion.

 

 

 

Launch Rules:

 

SECTION sectionname [-shell shellname]

BEGIN

.

.

.

END

 

The Launch Rules are simply shell scripts that are executed after any selector that references it as a target is set to true. A launch rule will be executed a maximum of one time for any given job.