File Watcher job looking for multiple files

Document ID : KB000013949
Last Modified Date : 14/02/2018
Show Technical Document Details
Introduction:

When trying to use a File Watcher job to watch multiple specific files, the job finishes with FAILURE.

Question:

Can Workload Automation AE supports File Watcher jobs that watch more than one specific files included in watch_file attribute? 

 

For example

/* ----------------- FW_multiple_files ----------------- */ 

 

insert_job: FW_multiple_files job_type: FW 

box_name: FW_box 

machine: anymachine

owner: anyowner 

permission: 

date_conditions: 0 

description: "FW job to watch multiple specific files" 

max_run_alarm: 120 

alarm_if_fail: 1 

watch_file: /tmp/test11.txt, /tmp/test21.txt, /tmp/test31.txt 

watch_interval: 60 

Environment:
CA Workload Automation AE r11.3x
Answer:

watch_file: /tmp/test11.txt, /tmp/test21.txt, /tmp/test31.txt is not supported.

You could use wildcard characters in your file name like watch_file: /tmp/test?1.txt 

This cause the file watcher job to monitors files with a format name such as: /tmp/test11.txt, /tmp/test21.txt, /tmp/test31.txt/.

By design the file watcher job will return SUCCESS when the first file matching the criteria is found. 

If you want to watch for any specific file, then you need to define multiple file watcher jobs to make sure each file is monitored.