Skip to content
TechieGuy12 edited this page Jan 12, 2022 · 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>
    <watch>
        <path></path>
        <timeout></timeout>
        <filters></filters>
        <exclusions></exclusions>
        <notifications></notifications>
        <actions></actions>
        <commands></commands>
    </watch>
</watches>

Child 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.
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 File Watcher is started.
filters The files, folders, or paths to only include when a change is detected. For more information, see Filters.
exclusions The files, folders, or paths to exclude when a change is detected. For more information, see Exclusions.
notifications Send a specified notification to an API endpoint when a change is detected. For more information, see Notifications.
actions Perform an action when a change is detected. For more information, see Actions.
commands Run a command when a change is detected. For more information, see Commands.

At least one <notifications>, <actions>, or <commands> 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