Professional Documents
Culture Documents
ON ICE COMMAND sendevent -e JOB_ON_ICE -j us_vasanth_test1_job1 OFF ICE COMMAND sendevent -e JOB_OFF_ICE -j us_vasanth_test1_job1
KILL COMMAND sendevent -e KILLJOB -j us_vasanth_test1_job1 TERMINATED COMMAND sendevent -e CHANGE_STATUS -s TERMINATED -J us_vasanth_test1_job1 SUCCESS COMMAND
DELETE JOB Sendevent -e DELETEJOB j us_vasanth_test_job1 GETTING REPORT autorep -j job_name -r -1 report on the job for the day -1 (prev day) Autorep -J job_name -r -5 report on the job for last 5th run Autoping
Autoping m machine|ALL} [-A][-D]
-A Send an alarm if problems are detected. -D Check the database connections on the specified machine(s). Jil
jr jobname j
CHECKING THE DETAILS OF THE JOB jr jobname -w autorep -J job_name d autorep -J job_name -q > file_name queries Checking the logs similar to events in job console cat event_demon.PPR | grep j (job name) /opt/autosys/autouser/out > cat event_demon.PPR.06042011
List of all ON_HOLD jobs jr ALL | grep OH status Lists all the jobs that are in On-Hold
List of all INACTIVE jobs jr ALL | grep IN Lists all the jobs that are in Inactive status
* job_depends -c -J us_chaity_p% * mailx chaitanya.karanam@eds.com < chaity.txt * mailx -s "subject" chaitanya.karanam@eds.com < chaity.txt
************************************************ ************************************************
4. sendevent -E STARTJOB -J job_name : Normally start Autosys job. sendevent -E FORCE_STARTJOB -J job_name : Forcefully starts Autosys job. [JOB_ON_ICE, JOB_OFF_ICE, JOB_ON_HOLD, JOB_OFF_HOLD, SET_GLOBAL, STOP_DEMON. . . .] sendevent -E STOP_DEMON - to stop AutoSys sendevent -E SET_GLOBAL -G "var_name=/home/mydir" : To set a variable in Autosys sendevent -E SET_GLOBAL -G "var_name=DELETE" : To delete Autosys variable that is declared/set
5. chk_auto_up: checks to see if event processor and the DB are both up. 6. autoping -m machine: verify that both client & server are correctly configured. 7. cron2jil -f cronfile [-d outdir] [-I incl_file] [-m machine] [-p prefix] 8. jil: To insert autosys job directly into the DB
/* ----------------- template test.jil ----------------- */ insert_job: template job_type: c box_name: box1 command: <unix command i.e. ls -l> machine: localhost owner: $jil < test.jil 9. autosyslog e : same as tail -f autosys_log_file. This command must be run from the machine where the server resides if used with the -e option. Else it can be used with the -J option to see that job's run log. 10. job_depends: -[cdt] -J jobname [-F "mm/dd/yy time"] [-T "mm/dd/yy time"] (Note: It will only print out the first occurrence found) 11. monbro -n monitor_name: Allows you to run from command line monitor/browser programs previously created using the monitor/browser GUI.exec superuser: AUTOSYS superuser 12. autocal_asc full_cal_name : prints, adds & deletes custom calendar definitions. 13. autostatus: Reports the current status of a specific job, or the value of an AutoSys global variable. Ex: autostatus -J job_name, -S instance 14. autotimezone -l : Allows additions, deletions, and queries to the timezones table (-l provides list). 15. autotrack: Tracks & report changes to the AutoSys DB. Ex: autotrack -l 2 (level 2) [sets the tracking level] autotrack -U sys -v (user sys: verbose) To start using the autotrack utility type: autotrack -u to set tracking level 1 or 2. By default it is set to 0. Autotrack -l will list the current tracking level. Options -[J, U, m, F, T, and t] are to request reporting on a specific Job, User, machine, time window (-F -T), and event type (t). Type is used in conjunction w/other parameters. autotrack w/no arguments retrieves information an all events omitting detail. -v option is for verbose.
16. autosys_secure: to change edit, exec superusers, change DB passwd, change remote authentication method. 17. chase [-AE]: Makes sure that jobs claiming to be running in the client machine are running. The "-E" option restarts the job. 18. archive_events: to archive events in the DB which are older than x days to prev DB from becoming full. 19. clean_files: Deletes old remote agent log files. It does it by searching the DB for all machines which have had jobs started on them. 20. autostatad: to get the status of a PeopleSoft job. You can define one of the user definable buttons to view PeopleSoft job: Autocons*userButton1Label: Adapter Status.
How to configure:
Autocons*userButton1Command: /autosys/bin/autostatad -J $JOB -g & (which allows you to have a command button on the operator's console.)
Dependencies:
success (job) and s(job_b) failure(job_a) or f (job_b) notrunning (job) terminated(job) exitcode(job) > 5 and exitcode(job_b) != 10 value(global_name)=100 done(job)
Solid black line: Hostscape can communicate with the remote agent in the client machine. Solid red line: Hostscape can't communicate with the remote agent but it can communicate with the internet daemon (inetd) running on that machine.. Dashed red line: Hostscape can't communicate with the client machine at all. Client is probably down.
Accessing a variable name: $$GLOBAL_VAR_NAME (unless used in dependency condition with a job definition. If used in the "command" field, you must use the $$)
Tunable Parameters:
DB_ROLLOVER DB_PROBLEM EP_HIGH_AVAILABILITY EP_ROLLOVER EP_SHUTDOWN $AUTOUSER/out/event_demon.$AUTOSERV ($AUTOUSER/out/event_demon.ACE) Output from the job definition output & error files /tmp files created for job_run at client machine $AUTOSYS/out/DBMaint.out for DB problems $SYBASE/install/errorlog_$DSQUERY when event server will not start. NT: AutoNuTc\lib/X11\app-defaults\xpert
Environment file: /etc./auto.profile C programs: $AUTOSYS/code Where to change AutoSys screen fonts: /usr/openwin/lib/app-defaults Where to look for troubleshooting: Chapter 15 Summary of commands: Appendix C $AUTO_JOB_NAME: when naming a file dynamically using as prefix AutoSys's job name. $AUTORUN: unique identifier for the run of that job $AUTOPID: unique identifier for that job's run number (PID) $JOID: DB identifier for a job. To extract from the DB: select joid from job where job_name=" "
NOTES:
When a job is stuck in the starting condition this means that the event processor communicated with the remote agent and passed all the information the remote agent ran the job but was not able to communicate to the DB. Once testing is done with AutoSys one should change the default refresh interval for AutoSys. This is so there is less querying to the DB. When AutoSys goes from dual mode to single
mode, always run the autobcp command before bringing AutoSys back to dual mode/High Availability. Default behavior for stdout is to always appends. If you want to overwrite the file enter the following, no spaces: ">file.out"
Box Logic
Use boxes to group jobs with like scheduling parameters, not as means of grouping jobs organizationally. For example, if you have a number of jobs that run daily at 1:00 a.m., you could put all these jobs in a box and assigning a daily start condition to the box. However, a variety of account processing jobs with diverse starting conditions should not be grouped in the same box.
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." Default SUCCESS is described in Default Box Success and Box Failure on page 5-13. 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." Default FAILURE is described in Default Box Success and Box Failure on page 5-13. Unless otherwise specified, a box will run indefinitely until it reaches a status of SUCCESS or FAILURE. For a description of how to override this behavior, see Box Job Attributes and Terminators on page 5-6. Changing the state of a box to INACTIVE (via the sendevent command) changes the state of all the jobs in the box to INACTIVE.
once. You will most likely find that the default behavior of boxes inhibits the expected execution of the jobs you placed in the box. Likewise, you should not place jobs in a box solely because you want to run reports on all of them. When you run autorep on a box, you will get a report on the box and all the jobs in the box (unless you use the -L0 option). In addition, if you use wildcarding when specifying a job name, you could get duplicate entries in your report. For example, suppose you have a box named "acnt_box" containing three jobs named "acnt_job1", "acnt_job2", and "daily_rep". If you specify acnt% as the job name for the autorep report, the report will have an entry for the box "acnt_box" and an entry for each job in the box. Then autorep will continue searching for all job names matching the wildcard characters and, thus, will list "acnt_job1" and "acnt_job2" a second time.
"job_a" is defined to run repeatedly until it succeeds. "job_report" has one starting condition-the success of "job_a".
owner: user@boxName permission: gx,ge,wx,we,mx,me box_name: BW_CRD_SOD_BOX condition: s(BW_CRD_SOD_POLL_DB) description: "BW_CRD_SOD_GEN_PORTIA_FILE" std_out_file: /home/crd_user/BW_CRD_SOD_GEN_PORTIA_FILE_OUT.log std_err_file: /home/crd_user/BW_CRD_SOD_GEN_PORTIA_FILE_ERR.log max_run_alarm: 60 alarm_if_fail: 1 insert_job: BW_CRD_SOD_PORTIA_FUND_FW job_type: f machine: BoxName owner: user permission: gx,ge,wx,we,mx,me box_name: BW_CRD_SOD_BOX condition: s(BW_CRD_SOD_GEN_PORTIA_FILE) #date_conditions: 1 #run_calendar: lm_weekday #start_mins:0,5,10,15,20,25,30,35,40,45,50,55 #run_window: "9:00 - 23:00" description: "BW_CRD_SOD_PORTIA_FUND_FW" watch_file: E:\import\fileName.txt watch_interval: 2 watch_file_min_size: 100 alarm_if_fail: 1
************************************************ ************************************************
~ tilde (~) ~ ~ By default you are in command mode. Switch to insert mode, by pressing the 'i' key. Then type some text, using ENTER or RETURN to start new lines. For example: Hello. (This is my first session in the vi editor) This is the second line of text. ~ ~ ~ 3)To Exit vi When you have finished entering your sample text, press 'Esc' to return to command mode. To save the file: The command for this is ':w' :w firstfile The command for close the editor is ':q' :q :x <Return> quit vi, writing out modified file to file named in original invocation :wq <Return> quit vi, writing out modified file to file named in original invocation :q <Return> quit (or exit) vi :q! <Return> quit vi even though latest changes have not been saved for this vi call Saving and Reading Files :r filename<Return> read file named filename and insert after current line :w<Return> write current contents to file named in original vi call :w newfile<Return> write current contents to a new file named newfile :12,35w smallfile<Return> write the contents of the lines numbered 12 through 35 to a new file named smallfile :w! prevfile<Return> write current contents over a pre-existing file named prevfile Moving the Cursor To move the cursor around the screen, you must be in command mode h - Cursor left j - Cursor down k - Cursor up l - Cursor right 0 - (zero) $ - move cursor to end of current line W - move cursor to beginning of next word :0<Return> or 1G - move cursor to first line in file :n<Return> or nG - move cursor to line n :$<Return> or G - move cursor to last line in file
Cutting and Pasting Text Yy copy (yank, cut) the current line into the buffer Nyy or yNy copy (yank, cut) the next N lines, including the current line, into the buffer P put (paste) the line(s) in the buffer into the text after the current line Deleting a character: While you are in insert mode, you can delete a character that you have just typed by using the 'backspace' key Load vi, and go into insert mode. Enter the following text: 'abcdefg'. Then press 'Esc' to return to command mode. Move the cursor back, using the left arrow or 'h' key, until the cursor points to the letter 'd'. Then press 'i' to go back into insert mode, and type 'hijklmn'. Now try to delete some of the characters using the backspace key. You will find that you can delete the characters that you have entered since being insert mode,. So the 'abc' will remain undeleted. So how do we delete any characters that were entered in previous insert mode sessions? Go back into command mode, place the cursor over the character to be deleted, then press the 'x' key. Repeating a command To delete 20 characters from a file, starting from the current position, using the command '20x' type '5l'. Notice how the cursor move 5 places to the right. Deleting a line delete an entire line : with the 'dd' command Load vi, and go into insert mode Enter several lines of text, preferably at least 10 Then return to command mode. Move the cursor up to the top of the screen Inserting or Adding Text *i insert text before cursor, until <Esc> hit I insert text at beginning of current line, until <Esc> hit *a append text after cursor, until <Esc> hit A append text to end of current line, until <Esc> hit *O open and put text in a new line below current line, until <Esc> *O open and put text in a new line above current line, until <Esc> * u UNDO WHATEVER YOU JUST DID; a simple toggle Determining Line Numbers :.= returns line number of current line at bottom of screen := returns the total number of lines at bottom of screen ^g provides the current line number, along with the total number of lines, in the file at the bottom of the screen
Changing Text
Basic vi Commands
What is vi?
The default editor that comes with the UNIX operating system is called vi (visual editor). [Alternate editors for UNIX environments include pico and emacs, a product of GNU.] The UNIX vi editor is a full screen editor and has two modes of operation: 1. Command mode commands which cause action to be taken on the file, and 2. Insert mode in which entered text is inserted into the file. In the command mode, every character typed is a command that does something to the text file being edited; a character typed in the command mode may even cause the vi editor to enter the insert mode. In the insert mode, every character typed is added to the text in the file; pressing the <Esc> (Escape) key turns off the Insert mode. While there are a number of vi commands, just a handful of these is usually sufficient for beginning vi users. To assist such users, this Web page contains a sampling of basic vi commands. The most basic and useful commands are marked with an asterisk (* or star) in the tables below. With practice, these commands should become automatic. NOTE: Both UNIX and vi are case-sensitive. Be sure not to use a capital letter in place of a lowercase letter; the results will not be what you expect.
vi -r filename
To Exit vi Usually the new or modified file is saved when you leave vi. However, it is also possible to quit vi without saving the file. Note: The cursor moves to bottom of screen whenever a colon (:) is typed. This type of command is completed by hitting the <Return> (or <Enter>) key. * :x<Return> quit vi, writing out modified file to file named in original invocation
:wq<Return> :q<Return>
quit vi, writing out modified file to file named in original invocation quit (or exit) vi
* :q!<Return> quit vi even though latest changes have not been saved for this vi call
* $
move cursor to end of current line w move cursor to beginning of next word b move cursor back to beginning of preceding word :0<Return> or 1G move cursor to first line in file
:n<Return> or nG :$<Return> or G
Screen Manipulation
The following commands allow the vi editor screen (or window) to move up or down several lines and to be refreshed. ^f move forward one screen ^b move backward one screen ^d move down (forward) one half screen ^u move up (back) one half screen ^l redraws the screen ^r redraws the screen, removing deleted lines
insert text at beginning of current line, until <Esc> hit append text to end of current line, until <Esc> hit
* o open and put text in a new line below current line, until <Esc> hit * O open and put text in a new line above current line, until <Esc> hit
Changing Text The following commands allow you to modify text. replace single character under cursor (no <Esc> needed) replace characters, starting with current cursor position, until <Esc> hit change the current word with new text, starting with the character under cursor, until <Esc> hit change N words beginning with character under cursor, until <Esc> hit; e.g., c5w changes 5 words change (replace) the characters in the current line, until <Esc> hit change (replace) the entire current line, stopping when <Esc> is hit or cNc change (replace) the next N lines, starting with the current line, stopping when <Esc> is hit
* r
R cw cNw C cc Ncc
Deleting Text The following commands allow you to delete text. * x delete single character under cursor Nx delete N characters, starting with character under cursor dw delete the single word beginning with character under cursor delete N words beginning with character under cursor; dNw e.g., d5w deletes 5 words delete the remainder of the line, starting with current cursor position * dd delete entire current line delete N lines, beginning with the current line; Ndd or dNd e.g., 5dd deletes 5 lines
D
Cutting and Pasting Text The following commands allow you to copy and paste text. yy copy (yank, cut) the current line into the buffer Nyy or yNy copy (yank, cut) the next N lines, including the current line, into the buffer
p
put (paste) the line(s) in the buffer into the text after the current line
Other Commands
Searching Text
A common occurrence in text editing is to replace one word or phase by another. To locate instances of particular sets of characters (or strings), use the following commands. /string search forward for occurrence of string in text
?string n N
search backward for occurrence of string in text move to next occurrence of search string move to next occurrence of search string in opposite direction
Determining Line Numbers Being able to determine the line number of the current line or the total number of lines in the file being edited is sometimes useful. :.= returns line number of current line at bottom of screen := returns the total number of lines at bottom of screen provides the current line number, along with the total number of lines, ^g in the file at the bottom of the screen
read file named filename and insert after current line (the line with cursor) write current contents to file named in original vi call write current contents to a new file named newfile write the contents of the lines numbered 12 through 35 to a new file named smallfile write current contents over a pre-existing file named
prevfile
Comments: