Trigger Files
- Last Updated: November 30, 2023
- 3 minute read
- MOVEit Automation
- Version 2023.1
- Version 2023
- Documentation
Using its scripting abilities, MOVEit Automation can be configured to use a "trigger" file to force the upload of a second "data" file of the same name from a local folder. This is a situation often encountered with mainframe file transfers, where a mainframe determines which files are to be transferred by using trigger files such as these.
In this example, we have a "trigger" folder named "d:\temp\altin". This folder contains three very small text files. (The contents of these files can be anything, but it is the names of the files which are important.)

We also have a "data" folder named "d:\temp\realdata". This folder contains 6 data files, but we only want to move a few of these files up to our selected destination.

We create a new script called "GetNamedFile.vbs" and import it into MOVEit Automation as a process named "GetNamedFile". This process does three things:
- Builds up the full path of the real data file given the name of a trigger file and a path specified as a task parameter.
- Replaces the contents of the working cache with the contents of the data file.
- Deletes (and scrubs) the original data file.
Next, we build a new task to download the trigger file, run the process and upload the data file.
- Either the source of the trigger file or destination of the data file can be a remote machine (FTP, SSH, MOVEit)
- However, the original data file must be on a local drive.
- Select the "Delete original file(s)" check box on the source. Trigger files should be destroyed as soon as they force an upload.

A critical addition to the task is the use of a Task Parameter to indicate where to find the data files. Be sure to add a Task Parameter called "DataPath" to your task with the full path of your data folder.
Run the task. The trigger files disappear.

Also notice that only the three selected data files are gone.

Finally, notice that the data files are where they are supposed to be on the destination. (Download one or two manually to make sure!)

Dim FileName, FilePath, FullPathFileName = MIMacro("[OrigName]")DataPath = MIGetTaskParam("DataPath")FullPath = DataPath & "\" & FileNameMIReplaceCacheFile(FullPath) MIDeleteFileSecure(FullPath)