-
Notifications
You must be signed in to change notification settings - Fork 32
Watch
The information about what path to watch is specified within the <watch>
element, which is a child element of the <watches>
root element. For each path you would like to watch, you will need to add a <watch>
element for each path. The configuration file can include multiple child <watch>
elements in the <watches>
element.
The <watch>
element contains child elements that specifies the path of the watch, as well as what to do when a change is detected.
Element | Description |
---|---|
path | Path of the folder to watch. File and folder exclusions are relative to the value specified in this element. |
timeout | The number of seconds to wait for the path to exist before establishing the watch. This timeout can be used with paths that are on external hard drives that may not be connected for a time when FileWatcher is started. |
exclusions | The files, folders, or paths to exclude when a change is detected. For more information, please read Exclusions. |
notifications | Send a specified notification to an API endpoint when a change is detected. |
actions | Perform an action when a change is detected. |
commands | Run a command when a change is detected. |
At least one <notifications>
, <actions>
, or <commands>
element must be specified or the watch won't perform any function when a change is detected.
Watch the path C:\Temp
for changes:
<watches>
<watch>
<path>C:\Temp</path>
</watch>
</watches>
Watch the path I:\Temp
for changes, but wait up to 5 minutes for the path to exist:
<watches>
<watch>
<path>I:\Temp</path>
<timeout>300</timeout>
</watch>
</watches>
Watch the path C:\Temp
for changes, and move any created file to the folder C:\Temp2:
<watches>
<watch>
<path>C:\Temp</path>
<actions>
<action>
<triggers>
<trigger>Create</trigger>
</triggers>
<type>Move</type>
<source>[fullpath]</source>
<destination>C:\Temp2\[fullpath]</destination>
<verify>true</verify>
</action>
<actions>
</watch>
</watches>