How to check whether a file is present or not using file watcher jobs in Autosys

4.8k Views Asked by At

There is arequirement which we need to fulfill using file watchers. I was wondering whether we can use file watchers to detect file successfully if the file is present before the file watcher job is started.

1

There are 1 best solutions below

1
On

JIL:

insert_job: APP_BATCH_FW_JOB
job_type: FW
machine: some@hostname
days_of_week: mon,tue,wed,thru,fri
start_times: "09:00"
watch_file: /app/input/infeed.txt
watch_interval: 60 # every 60 sec it would check for the file
term_run_time: 15 # after 15 mins the job would be terminated if file is not found

insert_job: APP_BATCH_START_JOB
job_type: CMD
machine: some@hostname
command: bash /app/script/start.bash
condition: SUCCESS(APP_BATCH_FW_JOB)

At 09:00 the file watcher job would start, and search for the file for 15 mins.

  • If file is found, the following batch start job would start.
  • If file is not found, the FW jon would be in terminated status by 09:15

User Manual