AutoSys Command Line Access Unix
To use AutoSys commands on the Linux servers, you must be logged in as yourself because accessibility has been done on user level not using system account level. Then, you will need to source a file from one of the directories under which AutoSys client has been installed for example: /opt/CA/r11. To choose the right file, you will need to identify which shell you are using and which AutoSys server you wish to use.
- To identify which shell you are using please use below command:
$ echo $SHELL
- For example my default shell is “ksh”
- Now locate install of AutoSys server using below command:
$ locate UC1
/opt/CA/r11/autouser.UC1
/opt/CA/r11/autouser.UC1/archive
/opt/CA/r11/autouser.UC1/audit
/opt/CA/r11/autouser.UC1/autosys.bash.UC1
/opt/CA/r11/autouser.UC1/autosys.csh.UC1
/opt/CA/r11/autouser.UC1/autosys.env.UC1
/opt/CA/r11/autouser.UC1/autosys.ksh.UC1
/opt/CA/r11/autouser.UC1/autosys.sh.UC1
/opt/CA/r11/autouser.UC1/config.UC1
/opt/CA/r11/autouser.UC1/out
- As you see above locate command gives results and out of all this we will have to use ksh shell as we saw that is our default shell using below command. That means we are using UC1 server with ksh shell:
$ source /opt/CA/r11/autouser.UC1/autosys.ksh.UC1
- To use the UC1 server with the bash shell:
$ source /opt/CA/r11/autouser.UG1/autosys.bash.UC1
- These scripts define several short aliases which you can use and learn by reading the files, example commands (e.g. autorep, sendevent, jil)
- If you are not familiar with command line AutoSys, below are here are few examples you can use after the above steps:
- $ autorep -J JOBNAME : Get information about the status of a job.
- $ autorep -J JOBNAME -q : Get information about the definition of a job. Suitable to be fed into the “jil” command.
- $ sendevent -E EVENT -J JOBNAME : Send an event to a job. Most likely events are KILLJOB and FORCE_STARTJOB.
- Plase note that percent character is a wild card. As such, if you don’t know the exact name of the job , you could issue command like:
- $ autorep -J javahonk%: To find information about all jobs that start with javahonk.
- 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
- Shortcuts alias type on Unix shell:
- alias fsj=’sendevent -E FORCE_STARTJOB -J’ –> After using alias command on unix shell then use: fsj “Job Name Here”
- alias sj=’sendevent -E STARTJOB -J’ –> After using alias command on unix shell then use: sj “Job Name Here”
- To put jobs on OFF ICE or ON ICE :
- sendevent -E JOB_OFF_ICE -J Job Name Here
- sendevent -E JOB_ON_ICE -J Job Name Here
- When the time changed for DST we had an issue with the times displayed by the autorep commands. In one case, the JIL showed that the job started at 6:55, and the log file confirmed that it was running at the correct time. However, autorep reported a time one hour earlier. To solve the problem, I set the TZ system property, and the autorep times were corrected.
- export TZ=US/Eastern
- To load JIL file on AutoSys server please use below:
- jil < JavaHonk.jil –> Where JavaHonk.jil is a file containing the job definition that you want to import.
For more information please refer CA documentation here