Wednesday, July 18, 2007

Box Job with n_retrys

This is an autosys box job which will
  • Re-execute itself if it fails and run_window did not expire.
  • Will not re-execute after first success even if the run window is not expired.
  • Will not re-execute itself if it fails and run_window is expired.

The definition:

/* ----------------- PREFIX_D_TEST_N_RETRYS_DEV ----------------- */
insert_job: PREFIX_D_TEST_N_RETRYS_DEV job_type: b
owner: owner@server1
permission: gx,mx,me
date_conditions: 1
days_of_week: su,mo,tu,we,th,fr,sa
start_times: "16:38"
n_retrys: 3
run_window: "15:30-17:30"
box_success: success(PREFIX_D_TEST_N_RETRYS_1_DEV) AND success(PREFIX_D_TEST_N_RETRYS_2_DEV)
box_failure: failure(PREFIX_D_TEST_N_RETRYS_1_DEV) OR failure(PREFIX_D_TEST_N_RETRYS_2_DEV)
description: "This is box job which will re-execute itself 3 times until it succeeds rovided run window did not expire"
std_out_file: /autosys/logs/output/$AUTO_JOB_NAME.`date "+%m%d"`.out
std_err_file: /autosys/logs/error/$AUTO_JOB_NAME.`date "+%m%d"`.err
alarm_if_fail: 1
profile: /autosys/profile/autoprofile

/* ----------------- PREFIX_D_TEST_N_RETRYS_1_DEV ----------------- */
insert_job: PREFIX_D_TEST_N_RETRYS_1_DEV job_type: c
box_name: PREFIX_D_TEST_N_RETRYS_DEV
command: rmdir /autosys/test
machine: server1
owner: owner@server1
permission: gx,mx,me
description: "This job will fail until /autosys/test is not created; it will be successful once directory is created."
std_out_file: /autosys/logs/output/$AUTO_JOB_NAME.`date "+%m%d%H%M"`.out
std_err_file: /autosys/logs/error/$AUTO_JOB_NAME.`date "+%m%d%H%M"`.err
alarm_if_fail: 1
profile: /autosys/profile/autoprofile

/* ----------------- PREFIX_D_TEST_N_RETRYS_2_DEV ----------------- */
insert_job: PREFIX_D_TEST_N_RETRYS_2_DEV job_type: c
box_name: PREFIX_D_TEST_N_RETRYS_DEV
command: echo "Job 2"
machine: server1
owner: owner@server1
permission: gx,mx,me
condition: success(PREFIX_D_TEST_N_RETRYS_1_DEV)
description: "This will always be successful"
std_out_file: /autosys/logs/output/$AUTO_JOB_NAME.`date "+%m%d%H%M"`.out
std_err_file: /autosys/logs/error/$AUTO_JOB_NAME.`date "+%m%d%H%M"`.err
alarm_if_fail: 1
profile: /autosys/profile/autoprofile


Friday, July 13, 2007

To Check Autosys Execution Status

Last execution:
autorep -J

Second last execution:
autorep -J CRST_D_RDP_REFRESH_DEV -r -1

Tuesday, May 22, 2007

Running Autosys Job on Success of Other

/* ----------------- PREFIX_TEST_SUCCESS_CON_DEV ------------ */
update_job: PREFIX_TEST_SUCCESS_CON_DEV job_type: c
command: ls -l
machine: IN01
permission: gx,mx,me
date_conditions: 1
days_of_week: su,mo,tu,we,th,fr,sa
run_window: "11:00-12:30"
start_times: "11:25"
std_out_file: /home/autosys/logs/output/$AUTO_JOB_NAME.`date "+%m%d"`.out
std_err_file: /home/autosys/logs/error/$AUTO_JOB_NAME.`date "+%m%d"`.err
alarm_if_fail: 1
profile: /home/autosys/profile/autoprofile

/* ----------------- PREFIX_TEST_SUCCESS_DEP_DEV ------------ */
insert_job: PREFIX_TEST_SUCCESS_DEP_DEV job_type: c
command: ls -l
machine: IN01
permission: gx,mx,me
date_conditions: 1
days_of_week: su,mo,tu,we,th,fr,sa
run_window: "11:00-12:30"
start_times: "11:22"
condition: success(PREFIX_TEST_SUCCESS_CON_DEV)std_out_file: /home/autosys/logs/output/$AUTO_JOB_NAME.`date "+%m%d"`.out
std_err_file: /home/autosys/logs/error/$AUTO_JOB_NAME.`date "+%m%d"`.err
alarm_if_fail: 1
profile: /home/autosys/profile/autoprofile

The second job will run only after the successfull completion of the first job. Starting 11:22 second job will monitor first job for success status.

Monday, May 21, 2007

Autosys Auto Restart on Failure

insert_job: PREFIX_TEST_AUTOSYS_DEV job_type: c
owner: dev@IN01
command: abcd
machine: IN01
permission: gx,mx,me
date_conditions: 1
days_of_week: su,mo,tu,we,th,fr,sa
n_retrys: 3
start_times: "10:32"
run_window: "00:00-10:35"
description: "This job is written to test n_retrys clause supported by autosys"
std_out_file: /home/autosys/logs/$AUTO_JOB_NAME.`date "+%m%d"`.out
std_err_file: /home/autosys/logs/$AUTO_JOB_NAME.`date "+%m%d"`.err
alarm_if_fail: 1
profile: /home/autosys/profile/autoprofile

This definition generates an autosys job which restarts itself 3 times in case of failure. If it succeeds it won't restart itself. If it fails and run window expires it still wont restart.