Skip to content
TechieGuy12 edited this page Jul 12, 2024 · 13 revisions

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.

Structure

<watches>
    <variables></variables>
    <logging></logging>
    <watch>
        <path></path>
        <id></id>
        <variables></variables>        
        <timeout></timeout>
        <filters></filters>
        <exclusions></exclusions>
        <needs></needs>
        <notifications></notifications>
        <actions></actions>
        <commands></commands>
        <workflows></workflows>
    </watch>
</watches>

Watches Elements

A <watches> element can contain the following child elements:

Element Description
variables (Optional) (Version 2.x or higher.) The variables for all child steps. For more information, see Variables.
logging (Optional) Logging information. For more information, see Logging.
watch A watch.

Watch Elements

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.
id (Optional) (Version 2.x or higher.) The unique ID for the watch.
timeout (Optional) 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 File Watcher is started.
filters (Optional) The files, folders, or paths to only include when a change is detected. For more information, see Filters.
exclusions (Optional) The files, folders, or paths to exclude when a change is detected. For more information, see Exclusions.
notifications (Optional) Send a specified notification to an API endpoint when a change is detected. For more information, see Notifications.
actions (Optional) Perform an action when a change is detected. For more information, see Actions.
commands (Optional) Run a command when a change is detected. For more information, see Commands.
workflows (Optional) (Version 2.x or higher.) A list of workflows that are to be executed as a series of steps. For more information, see Workflows.
needs (Optional) (Version 2.x or higher.) Watches that are required to run and complete before this watch is run. For more information, see Needs
variables (Optional) (Version 2.x or higher.) The variables for all child steps. For more information, see Variables.

At least one <notifications>, <actions>, <commands>, or <workflows> element must be specified or the watch won't perform any function when a change is detected.

With respect to filters and exclusions, exclusions will take precedence. This means that if a file or folder is matched by both a filter and exclusion, the file or folder will be excluded.

Examples

Watch the path C:\Temp for changes:

<watches>
    <watch>
        <path>C:\Temp</path>
    </watch>
</watches>

Watch the paths C:\Temp and I:\Temp:

<watches>
    <watch>
        <path>C:\Temp</path>
    </watch>
    <watch>
        <path>I:\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>
Clone this wiki locally