Creating a File Watcher Event
  • Updated on 05 Mar 2019
  • 2 minutes to read
  • Print
  • Dark
    Light

Creating a File Watcher Event

  • Print
  • Dark
    Light

A File Watcher event monitors a specified directory, then tells the system to perform an action when a file is added to that directory. The system can delete, move, or rename the file.
Use the Schedule Event dialog to create the event, and schedule the event to occur at any interval, including a custom interval set in the dialog's Advanced Calendar step.

Example

In the example,  create a File Watcher event using a dialog, set its interval using the advanced calendar, then see the event in action.
To begin, navigate to the folder System > Jobs and Events > Events and click the Add Event button.

2017-12-27_101602-1024x623.png

In the Please Select Events step, select File Watcher Event and click Next .

2017-12-27_101659.png

In the File Information step, enter the directory path that the File Watcher event should monitor. In the What do you want to do with file drop-down list, you can choose Delete, Move or Rename, for this example  select Rename .

2017-12-27_101945.png

A new field, Suffix , appears. Enter the suffix that should be appended to file names for any files added to the watched directory. 
You could also choose to add a filter that only runs the event on files with names that contain a certain string. 
Select Next .

2017-12-27_102014.png

In theEvent Info step, enter a name for the event in theName field.
By default, if the action fails, it is requeued. We could also choose to create a task if the job fails. 
Select Next .

2018-02-05_104124.png

The next step allows you to choose how often the watched file event is run. To set a custom interval, we select the Advanced option.

2018-02-05_110219.png

In the Advanced Calendar step, select Time Span Schedule and click Next .

2018-02-05_110426.png

The TimeSpanSchedule step allows you to set precise intervals using seconds, minutes, hours, days, months, and years.
To enter a value, click and drag the slider, or enter the value in the field.
In this example set the interval for 2 minutes and click Finish .

2018-02-05_111420.png

To see the File Watcher Event in action. Navigate to the watched directory and create a text document in it.
listening-for-new-file-event-09.save_new_document.png

After two minutes, the document is renamed with the suffix as we configured it in the Schedule Event dialog. 
listening-for-new-file-event-10.Document_renamed.png

Was this article helpful?