Directory monitoring is used to automatically start jobs when a change occurs within a specified folder.
A directory monitoring event is triggered when a change occurs in a directory. This change can be either:
- addition, renaming removal of a file or directory
In contrast to File Watching, a directory monitoring event is triggered when a change occurs in the directory - the number of files in the directory being monitored that cause the event is not significant. Therefore a job that handles directory monitoring events would have to handle the files associated with that event.
Please note that "Changing of a file" is no directory change event. Some Texteditors renew the file when saving it, so it sometimes seems that also "Changing file" is a trigger event. But in fact this is delete and add event that triggers the job execution.
Configuring a Standalone Directory Monitoring Job
The standard method of implementing Directory Monitoring is to start a Standalone Job every time a file is either added to or deleted from a monitored directory. In addition, a regular expression can be specified to start the job only when at least one regex matching file is in the directory. Please note that the file that triggers the event needs not match the regular expression.
The following screen shot shows how JOE - JobScheduler Object Editor is used to configure the monitoring of a directory
./monitor_dir . Additionally, only when at least one file with the extension txt is found in the directory, the job will be startet.
In the element tree in the left hand pane in JOE you will see the Run Options function for each job. Click on the New Dir button in the Start When Directory Changed area of the right hand pane to configure the directory that is to be monitored. Save this configuration by clicking the Apply Dir button after you have entered the
.*\.txt$ values in the Watch Directory and File Regex fields. Repeat this procedure to add further directories or patterns as required.
Standalone Jobs that are started by Directory Monitoring can also be started manually as required. Directory Monitoring can also be combined with scheduled Run Time configurations.
Directory Monitoring cannot be implemented for Order Jobs.
Feature in Detail
How To ... Articles
Frequently Asked Questions
- How To - Directory Monitoring and File Watching - a list of links to Knowledge Base articles - HowTos, FAQs, etc., related to Directory Monitoring
- The Directory Monitoring section of the JobScheduler Reference Documentation