Premium Feature — This feature is available in the Professional, Professional Plus, and Enterprise Editions. Learn more or contact LabKey

File Watchers let administrators set up the monitoring of directories on the file system and perform specific actions when desired files appear.

Create a File Watcher

  • Navigate to the folder where you want the files to be imported, i.e. the destination in LabKey.
  • Open the File Watcher management UI:
    • Select (Admin) > Folder > Management. Click the Import tab and scroll down.
    • In a study folder, you can instead click the Manage tab, then click Manage File Watchers.

Configure the Trigger

The two panels of the Create Pipeline Trigger wizard define a file watcher. Configuration options and on-screen guidance may vary for each task type.

Details

  • Name: A unique name for the trigger.
  • Description: A description for the trigger.
  • Type: Currently supports one value 'pipeline-filewatcher'.
  • Pipeline Task: The type of filewatcher task you want to create. By default the option you clicked to open this wizard is selected but you can change this selection from available options on the dropdown menu.
  • Run as username: The file watcher will run as this user in the pipeline. It is strongly recommended that this user has elevated permissions to perform updates, deletes, etc.
  • Assay Provider: Use this provider for running assay import runs.
  • Enabled: Turns on detection and triggering.
  • Click Next to move to the next panel.

Configuration

  • Location: File location to watch for uploadable files. This can be an absolute path on the server’s file system (beginning with a "/"), or a relative path under the container’s pipeline root (beginning with "." to indicate the current directory. Use "." to indicate the pipeline root directory (aka, the current directory) itself.
  • Include child folders: A boolean indicating whether to seek uploadable files in subdirectories (currently to a max depth of 3) of the Location you specify.
  • FilePattern: A Java regular expression that captures filenames of interest and can extract and use information from the filename to set other properties. We recommend using a regex interpreter, such as https://regex101.com/, to test the behavior of your file pattern. Details are in this topic: File Watcher Pattern Options.
  • Quiet period: Number of seconds to wait after file activity before executing a job (minimum is 1). If you encounter conflicts, particularly when running multiple filewatchers monitoring the same location, try increasing the quiet period.
  • Move to container: Move the file to this container before analysis. This must be a relative or absolute container path. If this field is blank, and the watched file is already underneath a pipeline root, then it will not be moved. If this field is blank but the watched file is elsewhere, it will be moved to the pipeline root of the current container. You must have at least Folder Administrator permissions in the folder where files are being moved to.
  • Move to subdirectory: Move the file to this directory under the destination container's pipeline root. Leaving this blank will default to the pipeline root. You must have at least Folder Administrator permissions in the folder where files are being moved to.
  • Copy file to: Where the file should be copied to before analysis. This can be absolute or relative to the current project/folder. You must have at least Folder Administrator permissions in the folder where the files are being copied to.
  • Parameter Function: Include a JavaScript function to be executed during the move. (See example here.)
  • Add custom parameter: These parameters will be passed to the chosen pipeline task for consumption in addition to the standard configuration. Some pipeline tasks have specific custom parameters available.
  • Click Save when finished.

Manage File Watchers

  • Navigate to the folder where you want to manage file watchers.
  • Select (Admin) > Folder > Management. Click the Import tab and scroll down.
    • In a study folder, you can instead click the Manage tab, then click Manage File Watchers.
  • Click Manage File Watcher Triggers.
  • All the file watchers defined in the current folder will be listed.
  • Hover to expose a (pencil) icon for editing.
  • Select a row and click the (delete) icon to delete.

Related Topics

Was this content helpful?

Log in or register an account to provide feedback


previousnext
 
expand allcollapse all