Chapter 10: File Watcher Jobs
File Watcher Jobs :
A File Watcher job is similar to a Command job. However, instead of starting a
user-specified command on a client computer, a File Watcher job starts a process that
monitors for the existence and size of a specific operating system file. When that file
reaches the specified minimum size and is no longer growing in size, the File Watcher
job completes successfully, indicating that the file has arrived.
Using File Watcher jobs provides a means of integrating events that are external to CA
Workload Automation AE into the processing conditions of jobs. For example, assume a
file must be downloaded from a mainframe, and it is expected to arrive after 2:00 a.m.
After it arrives, a batch job is run to process it, possibly even starting a whole sequence
of jobs.
You could set up a File Watcher job to start at 2:00 a.m., wait for the arrival of the
specified file, and exit. You could also set up the batch job so that the completion of the
File Watcher job is its only starting condition.
Note: To run these jobs, your system requires one of the following:
■ CA WA Agent for UNIX, Linux, Windows, or i5/OS
■ Legacy agent for Unicenter AutoSys JM 4.5.1 through r11
Define a File Watcher Job
You can define a File Watcher job to monitor for the existence and size of a file. CA
Workload Automation AE considers the watched file complete when the file reaches the
minimum file size specified in the watch_file_min_size attribute and the file reaches a
“steady state” during the polling interval. A steady state indicates that the watched file
has not grown during the specified interval.
Note: To run these jobs, your system requires one of the following:
■ CA WA Agent for UNIX, Linux, Windows, or i5/OS
■ Legacy agent for Unicenter AutoSys JM 4.5.1 through r11
Define a File Watcher Job
Follow these steps:
1. Insert a job and specify the following attributes in the definition:
job_type: FW
Specifies that the job type is File Watcher.
machine
Specifies the name of the machine on which the job runs.
watch_file
Specifies the path to and name of one or more files to monitor.
2. (Optional) Specify optional File Watcher attributes:
■ job_class
■ job_terminator
■ watch_file_min_size
Note: The default size to monitor is 0 (zero). If you do not specify the
watch_file_min_size attribute, the job completes if the file exists. You can
specify this attribute to override the default setting.
■ watch_interval
Notes:
– On the legacy agent, if you do not specify the watch_interval attribute, the
job checks the file every 60 seconds (the default). You can specify the
watch_interval attribute to override the default setting.
– On the CA Workload Automation Agent, if you do not specify the
watch_interval attribute, the job checks the file every 30 seconds (or the
time specified in the agent's filemonplugin.sleepperiod parameter). If you
specify this attribute for a FW job that is submitted to an the CA WA agent,
the agent uses the value as a “no-change” or steady interval. The steady
interval means that once the file condition is satisfied the file must remain
steady for the duration specified by the watch_interval attribute.
3. (Optional) Specify common attributes that apply to all job types.
The File Watcher job is defined.
Notes:
■ This guide provides instructions for defining jobs interactively. You also create job
definitions in script files and then import them using the jil command or use CA
WCC to define them. For more information about the JIL command and JIL syntax,
see the Reference Guide. For more information about using CA WCC to define the
job, see the CA Workload Control Center Workload Scheduling Guide.
Define a File Watcher Job
Chapter 10: File Watcher Jobs 299
Example: Monitor a File Every 120 Seconds
This example monitors the watch_file.log file on the winagent computer. The job
completes when the file reaches 10,000 bytes and maintains a steady state for at least
120 seconds (30 seconds for the agent’s global poll interval plus 90 seconds for the
watch_interval).
insert_job: fw_job
job_type: FW
machine: winagent
watch_file: “c:\tmp\watch_file.log”
watch_file_min_size: 10000
watch_interval: 90
Example: Monitor a File Every 60 Seconds on a Legacy Agent
This example monitors the watch_file.log file on the unixagent computer. The unixagent
is a legacy agent. The job completes when the file reaches 10000 bytes and maintains a
steady state for 60 seconds.
insert_job: fw_job
job_type: FW
machine: unixagent
watch_file: /tmp/watch_file.log
watch_file_min_size: 10000
watch_interval: 60
No comments:
Post a Comment
Note: only a member of this blog may post a comment.