File Watcher Job
The File Watcher job, Job:FileWatcher, enables you to detect the creation or deletion of a file in the time frame that you define.
The following example shows how to define a File Watcher job of both types—Job:FileWatcher:Create and Job:FileWatcher:Delete.
{
"FWJobCreate" :
{
"Type" : "Job:FileWatcher:Create",
"RunAs":"controlm",
"Path" : "C:/path*.txt",
"SearchInterval" : "45",
"TimeLimit" : "22",
"StartTime" : "201705041535",
"StopTime" : "201805041535",
"MinimumSize" : "10B",
"WildCard" : true,
"MinimalAge" : "1Y",
"MaximalAge" : "1D2H4MIN"
},
"FWJobDelete" :
{
"Type" : "Job:FileWatcher:Delete",
"RunAs":"controlm",
"Path" : "C:/path.txt",
"SearchInterval" : "45",
"TimeLimit" : "22",
"StartTime" : "201805041535",
"StopTime" : "201905041535"
}
}
The following table describes the File Watcher job parameters.
Parameter |
Description |
---|---|
Path |
Defines the pathname of the file that is detected. You can use any of the following wildcards:
|
SearchInterval |
Defines the number of seconds between successive attempts to detect a file creation or deletion. |
TimeLimit |
Determines the maximum amount of time, in minutes, to execute the process without detecting the file at its minimum size (for Job:FileWatcher:Create) or detecting its deletion (for Job:FileWatcher:Delete). If the file is not detected or deleted in this specified time frame, the process terminates with an error return code. Default: 0 (no time limit) |
StartTime |
Determines the time when File Watcher starts to monitor the file, as follows:
201805041535: File Watcher starts to watch for the file at 3:35 PM on 4 May 2018. |
StopTime |
Determines when File Watcher stops monitoring the file, as follows:
|
MinimumSize |
Defines the minimum file size that File Watcher monitors, in the following format: <Number><File_Size> where File_Size is any of the following sizes:
If the pathname contains wildcards, File Watcher monitors for the minimum file size only when you set the Wildcard parameter to true. |
Wildcard |
Determines whether File Watcher monitors for the minimum file size of a file when the pathname contains wildcards. Valid Values:
Default: false |
MinimalAge |
(Optional) Determines the minimum amount of time that must have passed since the file was last modified.
|
MaximalAge |
(Optional) Determines the maximum amount of time that can pass since the file was last modified.
|