Anda di halaman 1dari 5

Autosys commands:

AutoSys is an automated job control system for scheduling, monitoring, and reporting 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
There are three types of jobs: command, file watcher, and box.
Command jobs execute commands
Box jobs are containers that hold other jobs (including other boxes)
File watcher jobs watch for the arrival of a specified file.
An autosys box
W9DCPOST_AVRM_BOX
--------W9RCH_LOG_AVRM_JOB
----W9RCINP_POST_AVRM_JOB
----W9IPCCLEAN_POST_AVRM_JOB ----W9REPORT_POST_AVRM_JOB ----W9ENDSTAT_POST_AVRM_JOB ----W9DONE_POST_AVRM_JOB
----W9REVOP_TRAFF_AVRM_JOB ----W9REVOP_POST_AVRM_JOB
-----

IN 0/0
Box name, Status is INACTIVE
----IN 0/0
Jobs under box
----IN 0/0
----IN 0/0
----IN 0/0
----IN 0/0
----IN 0/0
----IN 0/0
----IN 0/0

Status of autosys jobs:


A job can have one of the following statuses:
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
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. If a job is set inactive while it is in a
running status, the job will not be given an end time. This will cause the job to never run again per its
schedule. The only way to get the process to run again is to either send a FORCE_STARTJOB event or
give the process an end time by either marking it successful or by terminating the process.
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.
Running. The job is running
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.
Failure. The job exited with an exit code greater than the maximum exit code for success.

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 might also be terminated if it has exceeded the
maximum run time, or if it was killed from the command line via a UNIX kill command.
Command type jobs that Terminate will automatically be set to Failure for proper notification and tracking.
ON_HOLD. This job is on hold and will not be run until it receives the JOB_OFF_HOLD event or the
FORCE_STARTJOB command is issued.
RESTART. The job was unable to start due to hardware or application problems, and has been scheduled
to restart.
QUE_WAIT. The job has met all conditions but there are not enough machine resources available.

ON_ICE. This job is removed from all conditions and logic, but is still defined to
AutoSys. This is done usually just before decommissioning jobs.
Autosys Commands:
PS: You can set aliases for all these commands like one mentioned below
alias fs=sendevent -E FORCE_STARTJOB -J;
Commands:
1. autorep j ROL%

List out all jobs starting with ROL.

2. autorep j ROL% | grep RU Lists only the running jobs.(Use status for getting required output,
Status list in page 2)
3. autorep j W9DCPOST_AVRM_BOX -r -1 To check yesterdays job status i.e., number of run
back. If you want to check for previous days, try r -2, -r -3 etc
4.

autorep -j W9DCPOST_AVRM_BOX d To get detailed status history of job.

5.

autorep -j W9ADF_UP_POST_04_AVRM_JOB q To get complete details of job which includes


command, box name, machine details, conditions, permissions etc.

6. autorep j ROL% -l0 If you want report of the box use l0 (level 0) option.
7.

autosyslog -J JobName To see the logs of job.

8. chk_auto_up

Command to check if event processor and DB are up and running.

9. autoflags a
Lists autosys and system configuration details.
$ autoflags
Usage: autoflags -a|i|o|d|v|x|r|h|n
a -- ALL information
i -- tape id #
o -- operating system
d -- database
v -- AutoSys version #
x -- AutoSys full version #
r -- AutoSys release #
h -- hostid
n hostname
10. job_depends -t -J ALL -F:from_date in dd/mm/yyyy -T:to_date in dd/mm/yyyy Display all scheduled
jobs to run between these two dates.

11. eventor [-M machine_name] : Starts the event processor.


12. autostatus -J job_name Reports the current status of a specific job, or the value of an AutoSys
global variable.
13. Clean_files: clean_files command deletes old remote agent log files
clean_files -d days
14. Chase : You should run chase command if a job is running longer than expected and you suspect it
may have abnormally ended but still shows as running
That the job is running.
Remote agent is running.
Chase -A Sends alarms to alert.
Chase E Restarts jobs
No option Displays output on console.
15. jils: To submit jil to autosys db.
jil < /directory/autosys.jil
o
o

16. Sendevent command is used 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. To issue sendevent for a job, you must have execute
permission for that job.
sendevent -E event [-A alarm] [-B group]
[-G "global_name=value"] [-I application]
[-J job_name] [-k signal_numbers]
[-M max_send_trys] [-N machine] [-P priority]
[-q job_queue_priority] [-s status]
[-S instance] [-T "time_of_event"] [-U cancel_specified_event]
To set a job to inactive:
sendevent E CHANGE_STATUS J <JOB_NAME> -s INACTIVE C <<Comment>>
-C comment : You can use this option to specify why you sent a KILLJOB event and this comment is
viewable in an autorep report. If comment contains spaces, you must enclose it in ".
-J job_name: Identifies the job to which to send the specified event.
Eg:
sendevent -J ROL-MAINT -E FORCE_STARTJOB -C "Transient issue, restarting once"
To set a job to success
sendevent E CHANGE_STATUS J <JOB_NAME> -s SUCCESS
Note: Changing the status to RUNNING does not cause the job to run. It just changes the status of the
job in the database. Also, If you change the status of a box to INACTIVE, it changes all the jobs under the
box to INACTIVE
To force start a job:
sendevent E FORCE_STARTJOB J <JOB_NAME>

To put a job on hold


sendevent E JOB_ON_HOLD J <JOB_NAME>
sendevent -J testjob -E JOB_ON_HOLD -P 1
Change the status of a job called testjob to ON_HOLD to prevent its execution, and assign sendeevent a
high priority so it will be sent immediately.
To put a job on ice
sendevent E JOB_ON_ICE J <JOB_NAME>
To take a job off hold
sendevent E JOB_OFF_HOLD J <JOB_NAME>
To take a job off ice
sendevent E JOB_OFF_ICE J <JOB_NAME>
To kill a job
sendevent E KILLJOB J <JOB_NAME>
To start a job:
To start a job that has no starting conditions specified. Do not try this command on boxes as this
might screw up dependency; use Force start instead.
sendevent E STARTJOB J <JOB_NAME>
To set global variable:
To set a global variable named today having a value of 08/10/2011.
sendevent -E SET_GLOBAL -G "today=08/10/2011"
To delete Autosys variable that is declared/set:
sendevent -E SET_GLOBAL -G "today=DELETE"
To stop schedule:
To stop the scheduler at 2:30 a.m. on Aug 10, 2011 (-C for comment)
sendevent -E STOP_DEMON -T "08/10/2011 02:30" -C "stopped for upgrade"
sendevent -E STOP_DEMON To stop event processor
Note:
Do not attempt to stop the event processor by using the UNIX kill command. This stops the event
processor no matter what it is doing; it might be in the middle of processing an event. Also, if you are
using dual-event servers and use kill method, the databases can lose synchronization.
To remove job from autosys registry:

Sendevent E DELETEJOB J <JOB_NAME>


Please note:

When you set a job to SUCCESS or ON_ICE, the depending jobs on it may run because it is still
set to run.

If a job is ON_HOLD, it will not run until it is force started or set to inactive for a normal run.

Use KILL command to kill a job. Once the job has been KILLED, it can be marked ON-HOLD,
SUCCESS or INACTIVE, or whatever supported status you wish to assign to it.

Anda mungkin juga menyukai