File System Trigger

Description

Triggers task execution when one or more files are added, modified or deleted in the folder specified. Can also trigger execution when a number of files exceed the amount specified, when one file size exceeds the amount specified or when the total size of the monitored folder exceeds the amount specified.

NOTE:  File triggers will work on network drives and shares only if the target system is part of a domain and the computer where AutoMate resides has at least read access to the remote folder being watched. In addition, network folders need to be specified via UNC (Universal Naming Convention) path instead of a mapped drive. For example: Z:\PathName\FolderName should be \\ServeNname\PathName\Foldername. This is mainly due to the fact that mapped drives are only accessible when a user is logged on, however, UNC paths are accessible even when the computer is in a locked or logged off state.

Practical Usage

Most frequently used to monitor folders for incoming files. When these files arrive, they can be automatically copied, uploaded, renamed, encrypted, compressed or a number of other AutoMate actions can be used to complete the process.

Related Topics  

Parameters

General

Property

Type

Description

Folder

Text

The folder that this trigger will monitor. Click the Folder icon to navigate to the folder you wish to monitor or manually enter the full path and folder name in the provided text-box.

Include sub-folders

Yes/No

If set to YES (default), specifies that sub-folders that reside in the target folder (specified in the Folder parameter) will be monitored as well. If set to NO, sub-folders are ignored.

Wait for file to be accessible before triggering

Yes/No

If set to YES, specifies that the trigger will delay task execution until the target file(s) are accessible and no longer in a "locked" state. Non-accessible or locked files are usually being used by a user, application or other system resource. As soon as the file is no longer being used, the trigger will become active. If set to NO (default), file accessibility is ignored.

Use custom polling intervals for network shares.

Yes/No

If enabled, indicates the time frame (measured in seconds) that AutoMate should poll or "check" for the occurrence of the specified condition. This feature may reduce bandwidth in high traffic networks.

prerequisites

Property

Type

Description

File added

Yes/No

If set to YES, this trigger will monitor for the specified file(s) to be added to the target folder and start the task as a result. If set to NO, file additions will be ignored.

File removed

Yes/No

If set to YES, this trigger will watch for the specified file(s) to be removed from the target folder and start the task as a result. If set to NO (default) file removal will be ignored.

File renamed

Yes/No

If set to YES, this trigger will watch for the specified file(s) to be renamed and start the task as a result. If set to NO (default) file renaming will be ignored.

File modified

Yes/No

If set to YES, the trigger will start the task as a result of any modifications made to the specified file(s). File changes include alteration of contents or modification of attributes. If set to NO (default) file modifications will be ignored.

Folder added

Yes/No

If set to YES, this trigger will monitor for the specified folder(s) to be added to the target folder and start the task as a result. If set to NO (default), folder additions will be ignored.

Folder removed

Yes/No

If set to YES, this trigger will watch for the specified folder(s) to be removed from the target folder and start the task as a result. If set to NO (default) folder removal will be ignored.

Folder renamed

Yes/No

If set to YES, this trigger will watch for the specified folder(s) to be renamed and start the task as a result. If set to NO (default) folder renaming will be ignored.

Folder modified

Yes/No

If set to YES, the trigger will start the task as a result of any modifications made to the specified folder(s). Modifications include alteration of contents or modification of attributes. If set to NO (default) folder modifications will be ignored.

Number of files exceed

Number

Task execution starts when the total number of files in the target folder surpasses the value entered. If no value is entered, this parameter is ignored.

Number of folders exceed

Number

Task execution starts when the total number of folders in the target folder surpasses the value entered. If no value is entered, this parameter is ignored.

One file size exceeds

Number

Task execution starts when the size of a single file residing in the target folder surpasses the amount entered (in kilobytes). If no value is entered, this parameter is ignored.

Total file size exceeds

Number

Task execution starts when the total size of the folder being monitored exceeds the amount of kilobytes entered. If no value is entered, this parameter is ignored.

NOTE: Selecting two or more of the above prerequisites will cause the trigger to behave as an OR statement as opposed to an AND statement. For example, enabling the File Added parameter and entering the value 1 under the Number of files exceed parameter will activate the trigger when a file is added to the specified folder OR when the number of files in the specified folder exceeds the amount of 1.   

Filters

Property

Type

Description

Include Mask

Text

Specifies any filter(s) that should be included in the search. This parameter supports full path and filename entry (i.e. c:\temp\filename.txt) as well as the use of wildcard characters (i.e. c:\temp\*.txt). Additionally, multiple filters can be specified by using a pipe (|) character to separate each file (i.e. c:\temp\*.txt|*.jpg|*.xls). See File Masks & Wildcards for more details.

Exclude Mask

Text

Specifies the filter(s) to be omitted from the search. This parameter supports full path and filename entry (i.e. C:\Temp\filename.txt), as well as the use of wildcard characters (i.e. c:\temp\*.txt). Additionally, multiple filters can be specified by using a vertical bar or pipe to separate each filter (i.e. c:\Temp\*.txt|C:\Temp\*.jpg|C:\myFolder\*.xls). See File Masks & Wildcards for more details.

Users

If this trigger is set to monitor a folder or file location on a network share or drive, or a location with limited or restricted access, a user with proper permissions to that share is required.

Property

Type

Description

No user required

Yes/No

If set to YES (default), no user account is required to access the specified drive or share. If set to NO, a valid user is required.

Use default user account

Yes/No

If set to YES, the user entered in the Default User properties will be used. Set to NO by default.

Use specified user account

Yes/No

If set to YES, the user account entered below will be used (disabled by default). This account will always override the Use default user option. Set to NO by default.

Username

Text

The username that this trigger should use to access the folder or file location on a network share or drive, or location with limited or restricted access.

Password

Text

The password that this trigger should use to access the folder or file location on a network share or drive, or location with limited or restricted access.

Domain or machine name

Text

The domain or machine name of the location being monitored.

NOTE: These options are only supported on Windows NT/2000/2003/XP operating systems. They are not supported on Windows Vista or Windows 7 operating systems.

Behavior

Property

Type

Description

Enable trigger

Yes/No

If set to YES (default), specifies that the trigger is enabled. If set to NO, the trigger is disabled.

Trigger on startup if condition is true

Yes/No

If set to YES, the trigger will act on conditions that already exist upon startup. If set to NO (default), existing conditions are ignored. For example, assume the file to monitor already exists in the target folder upon creation or startup of this trigger. Yes, will immediately launch the task, however, NO will not.

Trigger after the condition has been met 'X times

Yes/No

If set to YES, specifies how many times the trigger condition must be met before the task is started.

 

additional notes

AMTrigger

When this trigger is activated, it automatically passes the AMTrigger object to the task. AMTrigger is a standard AutoMate dataset and can be used much like the datasets created by the SQL Query and Email actions. The fields of AMTrigger can be used within a task to determine specific values, such as whether or not the task was started by a trigger, which trigger started the task, when the trigger was activated and other properties. AMTrigger populates a unique set of field–value pairs for each AutoMate trigger. The following table lists the ones specific to this trigger. For more details about a specific AMTrigger field–value pair, click the associated link.

Name

Data Type

Return Value

AMTrigger.Action

String

Returns the file/folder related action that took place to cause the task to trigger.

AMTrigger.Count

Number

If the AMTrigger.Action field returns TOO MANY FOLDERS or TOO MANY FILES, this value is the total number of folders or files that activated the trigger.

AMTrigger.FileName

String

If the AMTrigger.Action field returns FILE ADDED, FILE MODIFIED or FILE DELETED, returns the path and filename of the file that was either added, modified or deleted (according to the file action that the user initially set for the trigger).

AMTrigger.FolderName

String

If the AMTrigger.Action field returns FOLDER ADDED, FOLDER MODIFIED or FOLDER DELETED returns the path and name of the folder that was either added, modified or deleted (according to the folder action that the user initially set for the trigger).

AMTrigger.NBFiles

Number

If the AMTrigger.Action field returns TOO MANY FILES, this value is the total number of files in the directory being monitored.

AMTrigger.OldFileName

String

If the AMTrigger.Action field returns FILE RENAMED, this value is the original filename.

AMTrigger.OldFolderName

String

If the AMTrigger.Action field returns FOLDER RENAMED, this value is the original name of the folder.

AMTrigger.Size

Number

If the AMTrigger.Action field returns ONE FILE TOO BIG, this value is the size (in KB) of the file or folder that activated the trigger.

 

NOTE: A full list of AMTrigger objects exclusive to each trigger can be viewed from the Expression Builder by expanding Objects -> Triggers and selecting the desired trigger.