File Watcher Job

The File Watcher job enables you to detect the creation or deletion of a file in the time frame that you define.

The following table describes the File Watcher job type attributes.

Attribute

Description

Run As

Defines the user name with the authorization to execute the job. This attribute is used by the Control-M security mechanism.

Rules:

  • Characters: 1-30
  • Case Sensitive: Yes
  • Invalid Characters: Blank spaces and ' (apostrophes).

Path

Defines the pathname of the file that is detected.

You can use any of the following wildcards:

  • *: One or more characters.

  • ?: One character.

Mode

Determines whether to detect creation or deletion of a file as follows:

  • Create: Detects the creation of a file according to the Time Frame and File Age that you define.

    File size is ignored if the Path parameter contains wildcards, unless the monitor file size when wildcard is used parameter is set to Y.

  • Delete: Detects the deletion of a file according to the Time Frame that you define.

    The File Watcher (ctmfw) utility, when executed in Delete mode, first checks for files that match the specified name. After a specified file is detected, the ctmfw utility checks at the specified interval for the deletion of that file.

Wildcard Monitoring

Defines if Control-M monitors the file size when the filename contains wildcards. This parameter is ignored if the filename does not contain a wildcard.

Minimum Size

Determines the minimum file size in bytes, KB, MB, or GB. This parameter is ignored if the Path parameter contains wildcards (unless the monitor file size when wildcard is used parameter is set to Y) or if the mode parameter is set to DELETE.

Variable Name: %%FTP-MINSIZEx

where x is a value between 1 and 5, according to the sequential transfer number.

File Size Interval

Determines the interval (in seconds) between attempts to monitor the size of a file after the detection of the file. This parameter is ignored when using wildcards in Path (unless the monitor file size when wildcard is used parameter is set to Y) or when using DELETE mode.

Iterations

Determines the number of attempts to monitor file size where the size remains static and greater than or equal to minimum detected size (indicating successful creation of the file). This parameter is ignored when using wildcards in FILE unless the monitor file size when wildcard is used parameter is set to Y) or when using DELETE mode.

Search Interval

Determines the interval between successive attempts to detect the existence/deletion of a file (in seconds).

Time Limit

Determines the maximum time (in minutes) to execute the process without detecting the file at its minimum size (CREATE) or detecting its deletion (DELETE). If the file is not detected/deleted in this specified time frame, the process terminates with an error return code.

Variable Name: %%FTP-TIMELIMITx

x indicates a value between 1 and 5, according to the sequential transfer number

Time Frame

Determines the absolute time span during which the utility monitors the file you want to watch.

Start

Determines the time when the utility starts monitoring the file, as follows:

  • Immediately: Starts monitoring the file when the job starts execution.

  • Custom: Starts monitoring the file at the time that you define.

Stop

Determines the time when the utility stops watching the file, as follows:

  • No Stop Time: Stops monitoring the file when the job ceases execution.

  • Custom: Stops monitoring the file at the time that you define.

File Age

Determines the minimum and maximum amounts of time that must have passed since the file you want to watch was last modified.

Minimal Age

Determines the minimum amount of time that must have passed since the file was last modified, as follows:

  • No Minimal Age: Monitors the file immediately after the file was modified.

  • Custom: Monitors the file when the amount of time that you define has passed after modification.

Variable Name: %%FTP-FILE_MIN_AGEx

x indicates a value between 1 and 5, according to the sequential transfer number

Maximal Age

Determines the maximum amount of time that can pass since the file was last modified, as follows:

  • No Maximal Age: Stops monitoring the modified file when the job ceases execution.

  • Custom: Stops monitoring the file when the amount of time that you define has passed after modification.

    If you selected No Maximal Age, files older than 50 years cannot be detected by the utility. If you want to detect files older than 50 years, you must define the number of years, such as 51y.

Variable Name: %%FTP-FILE_MAX_AGEx

x indicates a value between 1 and 5, according to the sequential transfer number