Create AutoSys Job Jil Example

Create AutoSys Job Jil Example

In previous tutorials you saw introduction of AutoSys and how to define jobs, what are required and optional attributes are there. In this example I will show you to how to write sample Jil job for all three kind command, box and file watcher.

  • Command job example:
/* ----------------- JavaHonk_SwapDivPaymentNotifier_c ----------------- */

insert_job: JavaHonk_SwapDivPaymentNotifier_c  job_type: c
owner: JavaHonk@JavaHonk
machine: JavaHonk.com
command: /apps/javahonk/JavaHonkNotifier/scripts/run-script.sh UAT start
permission: gx,ge,wx,we,mx,me
date_conditions: 1
days_of_week: mo,tu,we,th,fr
exclude_calendar: CORP_CHRISTMAS_NEWYRS_ONLY
start_mins: 01,06,11,16,21,26,31,36,41,46,51,56
run_window: "00:01-23:59"
description: "Load Dividend data"
condition: s(JavaHonk_GenProcessDiv_c)
term_run_time: 540
alarm_if_fail: 1
std_out_file: /apps/javahonk/JavaHonkNotifier/logs/JavaHonk_Notifier_c.out
std_err_file: /apps/javahonk/JavaHonkNotifier/logs/JavaHonk_Notifier_c_err.out
application: 1JavaHonk
  • Box job example:

Below is example of box which contains one command job inside it:

/* ----------------- JavaHonk_Box ----------------- */

insert_job: JavaHonk_Box   job_type: b
owner: JavaHonk
permission: mx,me
date_conditions: 1
days_of_week: mo,tu,we,th,fr
exclude_calendar: CORP_CHRISTMAS_NEWYRS_ONLY
start_times: "3:02"
description: "JavaHonk~ Box that contains all the jobs related to request settlement"
term_run_time: 120
max_run_alarm: 120
alarm_if_fail: 0
application: JavaHonk


 /* ----------------- JavaHonkBO ----------------- */

 insert_job: JavaHonkBO   job_type: c
 box_name: JavaHonk_Box
 command: ${JavaHonk_HOME_PATH}/bin/BOBatchSettlementRequest.ksh -t EDSO_OTC
 machine: JavaHonk.test.com
 owner: JavaHonk
 permission: gx,ge
 condition: s(ESORBATCH_BOServer_Box)
 description: "JavaHonk~ Starts the Bo batch request settlement"
 std_out_file: ${JavaHonk_HOME_PATH}/logs/JavaHonkBO.`date +%Y%m%d.%H%M`.out
 std_err_file: ${JavaHonk_HOME_PATH}/logs/JavaHonkBO.`date +%Y%m%d.%H%M`.err
 alarm_if_fail: 1
 application: JavaHonk
  • File watcher example:
/* ----------------- JavaHonk_file_watch ----------------- */

insert_job: JavaHonk_file_watch   job_type: f
box_name: JavaHonk_box
machine: JavaHonk.test.com
owner: JavaHonk
permission: gx,ge
date_conditions: 1
days_of_week: mo,tu,we,th,fr
exclude_calendar: CORP_CHRISTMAS_NEWYRS_ONLY
start_times: "20:35"
condition: s(JavaHonk_IMG_CurrentDate_c)
description: "JavaHonk~ Wait for the galaxy file in location"
watch_file: /nas/JavaHonk/datafiles/galaxygreeks.${JavaHonk_JavaHonk_CURRENT_DATE}.csv
watch_interval: 60
alarm_if_fail: 1
application: JavaHonk
  • Example of Box job contains command and file watcher jobs:
/* ----------------- JavaHonk_Greeks_Copy_box ----------------- */

insert_job: JavaHonk_Greeks_Copy_box   job_type: b
box_name: JavaHonk_EOD_PrePNL_Box
owner: JavaHonk
permission: mx,me
date_conditions: 1
days_of_week: mo,tu,we,th,fr
exclude_calendar: CORP_NYSE_HOLIDAYS
start_times: "19:20"
box_success: s(JavaHonk_greeks_local_copy) | (e(JavaHonk_NYSEHolidayChk_Greeks_Copy_c) = 1)
description: "JavaHonk~ Galaxy Greeks File copy process from RV location"
term_run_time: 180
max_run_alarm: 180
alarm_if_fail: 1
application: JavaHonk


 /* ----------------- JavaHonk_Greeks_Copy_From_RV_c ----------------- */

 insert_job: JavaHonk_Greeks_Copy_From_RV_c   job_type: c
 box_name: JavaHonk_Greeks_Copy_box
 command: cp -p ${JavaHonk_PROD_ZFSBASEPATH}/data/marks/galaxygreeks.${JavaHonk_JavaHonk_CURRENT_DATE}.csv ${JavaHonk_JavaHonk_HOME_PATH}/datafiles/
 machine: JavaHonk.test.com
 owner: JavaHonk
 permission: gx,ge
 condition: s(JavaHonk_IMG_CurrentDate_c) & s(JavaHonk_ELPD_GenGalaxyGreeks_c)
 description: "JavaHonk~ Copies the galaxygreeks.<date>.csv file as galaxygreeks.csv"
 term_run_time: 60
 std_out_file: ${JavaHonk_JavaHonk_HOME_PATH}/logs/JavaHonk_Greeks_Copy_From_RV_c.`date +%Y%m%d.%H%M`.out
 std_err_file: ${JavaHonk_JavaHonk_HOME_PATH}/logs/JavaHonk_Greeks_Copy_From_RV_c.`date +%Y%m%d.%H%M`.err
 alarm_if_fail: 1
 application: JavaHonk


 /* ----------------- JavaHonk_IMG_CurrentDate_c ----------------- */

 insert_job: JavaHonk_IMG_CurrentDate_c   job_type: c
 box_name: JavaHonk_Greeks_Copy_box
 command: sendevent -E SET_GLOBAL -G "JavaHonk_JavaHonk_CURRENT_DATE=`date '+%Y%m%d'`"
 machine: JavaHonk.test.com
 owner: JavaHonk
 permission: gx,ge
 condition: e(JavaHonk_NYSEHolidayChk_Greeks_Copy_c) = 0
 description: "JavaHonk~ Sets the date variable for converts watcher job."
 std_out_file: >>${JavaHonk_JavaHonk_HOME_PATH}/logs/JavaHonk_IMG_CurrentDate_c.`date +%Y%m%d.%H%M`.out
 std_err_file: >>${JavaHonk_JavaHonk_HOME_PATH}/logs/JavaHonk_IMG_CurrentDate_c.`date +%Y%m%d.%H%M`.err
 alarm_if_fail: 1
 application: JavaHonk


 /* ----------------- JavaHonk_NYSEHolidayChk_Greeks_Copy_c ----------------- */

 insert_job: JavaHonk_NYSEHolidayChk_Greeks_Copy_c   job_type: c
 box_name: JavaHonk_Greeks_Copy_box
 command: ${JavaHonk_JavaHonk_HOME_PATH}/bin/USDHolidayRunChk.ksh
 machine: JavaHonk.test.com
 owner: JavaHonk
 permission: gx,ge
 description: "JavaHonk~ Cehcks for holiday"
 term_run_time: 20
 std_out_file: ${JavaHonk_JavaHonk_HOME_PATH}/logs/JavaHonk_NYSEHolidayChk_Greeks_Copy_c.`date +%Y%m%d.%H%M`.out
 std_err_file: ${JavaHonk_JavaHonk_HOME_PATH}/logs/JavaHonk_NYSEHolidayChk_Greeks_Copy_c.`date +%Y%m%d.%H%M`.err
 alarm_if_fail: 1
 max_exit_success: 1
 application: JavaHonk


 /* ----------------- JavaHonk_greeks_file_watch ----------------- */

 insert_job: JavaHonk_greeks_file_watch   job_type: f
 box_name: JavaHonk_Greeks_Copy_box
 machine: JavaHonk.test.com
 owner: JavaHonk
 permission: gx,ge
 date_conditions: 1
 days_of_week: mo,tu,we,th,fr
 exclude_calendar: CORP_CHRISTMAS_NEWYRS_ONLY
 start_times: "20:35"
 condition: s(JavaHonk_IMG_CurrentDate_c)
 description: "JavaHonk~ Wait for the galaxy greeks file in uat nas location"
 watch_file: /nas/JavaHonk/datafiles/galaxygreeks.${JavaHonk_JavaHonk_CURRENT_DATE}.csv
 watch_interval: 60
 alarm_if_fail: 1
 application: JavaHonk


 /* ----------------- JavaHonk_greeks_local_copy ----------------- */

 insert_job: JavaHonk_greeks_local_copy   job_type: c
 box_name: JavaHonk_Greeks_Copy_box
 command: cp /nas/JavaHonk/datafiles/galaxygreeks.${JavaHonk_JavaHonk_CURRENT_DATE}.csv /apps/JavaHonk/uat/datafiles/
 machine: JavaHonk.test.com
 owner: JavaHonk
 permission: gx,ge
 date_conditions: 1
 days_of_week: mo,tu,we,th,fr
 exclude_calendar: CORP_CHRISTMAS_NEWYRS_ONLY
 start_times: "20:37"
 condition: s(JavaHonk_greeks_file_watch)
 description: "JavaHonk~ Copies the galaxygreeks.<date>.csv file from /nas/ to locally in UAT"
 term_run_time: 10
 std_out_file: ${JavaHonk_JavaHonk_HOME_PATH}/logs/JavaHonk_greeks_local_copy.`date +%Y%m%d.%H%M`.out
 std_err_file: ${JavaHonk_JavaHonk_HOME_PATH}/logs/JavaHonk_greeks_local_copy.`date +%Y%m%d.%H%M`.err
 alarm_if_fail: 1
 application: JavaHonk
  • For more details please CA documentation here

Leave a Reply

Your email address will not be published. Required fields are marked *