File trigger

Operation name

File trigger

Functional Overview

File trigger is a trigger function to execute scripts when a event of watch file being created/updated/deleted occurs.

Type of event to monitor

When creating new file

The trigger fires when the watch file is newly created.
Fire image

When updating file timestamp

The trigger fires when the watch file is overwritten/updated.
Fire image

When deleting file

The trigger fires when the watch file is deleted.
Fire image

Properties

File trigger settings
Item name Content Remarks
Trigger name Enter the name of the trigger.  
Watch event Select the trigger event to be monitored.
  • [When creating new file]:(default)
  • [When updating file timestamp]:
  • [When deleting file]:
 
Execute if the watch file already exists Select whether to fire the trigger when the watch file already existed.
  • [Checked]:
    If the file already exists at the time of DataSpiderServer startup or trigger registration/enabling, the trigger fires.
  • [Not Checked]:(default)
    If the file already exists at the time of DataSpiderServer startup or trigger registration/enabling, the trigger does not fire.
  • Enabled if [When creating new file] is selected in [Watch event].
Watch file Enter the path of the to be monitored.

Click [Browse] button to activate the file Selectr and select the file.
  • Please specify the absolute path of file.
  • To monitor a directory, please check [Observe directory].
  • Constrained Characters of DataSpider File System cannot be used except for path separator "/" and wildcard "*".
  • Wildcards ("*"( asterisk) only) are available in file names.
Select the file system to refer to.
  • [DataSpider filesystem]: (Default)
    Refer to the specific system of DataSpider.
  • [Server local filesystem]:
    Refer to the file system of the OS on which DataSpiderServer operates.
Observe directory
  • [Checked]:
    Monitor the directory specified in [Watch file].
  • [Not Checked]: (default)
    Not monitor the file specified in [Watch file].
 
Watch interval Enter the monitoring interval in seconds.
  • The default value is "10".
End option Select the option when the script execution ends.
  • [Do not delete watch file]: (default)
    Do not delete the watch file when the script execution ends.
  • [Delete watch file]:
    Regardless the success/failure of execution, deletes the watch file.
  • [Delete watch file only when trigger ended normally]:
    Delete watch file only when the script execution ended normally.
 
Execution content settings
Item name Content Remarks
Trigger owner Select the owner of the trigger to be created.
  • Can only be selected by users with administrator privileges.
    (Ordinary users can select themselves only.)
Execution user name Select the user to run script specified by [Script].  
Password Type the password associated with the user specified by [Execution user name].  
Service Select the script to run by trigger.
  • Project that was registered as a service displays.
Script Select the script to run by trigger.
  • Script in the service specified by [Service] displays.
Script arguments script input variables that is set in script specified by [Script] displays
Script arguments / Variable name Script variable name is displayed.
  • Can not be edited.
Script arguments / Type Script variable number type is displayed.
  • Can not be edited.
Script arguments / Value Enter a script variable value.
Execution option settings
For more information about Setting execution option, refer to "Execution option settings".

Trigger Variables

In file triggers, information about the watch file can be retrieved from the trigger variables.
Trigger variable is set to the script input variable of the executing script.

Trigger variable name Value Content Remarks
File path trigger.filepath The path of the file to be monitored.
  • Specify Example: ${trigger.filepath}
File name trigger.filename The name of the file to be monitored.
  • Specify Example: ${trigger.filename}

Specification limit

Main exceptions

Nothing.

Notes