One of the reasons why our clients love Triggers is because this feature makes it so easy to set up unmanned, automated file transfers that run overnight or over the weekend. But sometimes, you'll want to specify more than just a schedule. One particular client, for example, wanted to restrict a scheduled download to a certain set of files, which he wanted to specify using a regular expression or regex. This post details the steps we recommended for him to achieve that.
What we're trying to do
Find it interesting? Learn how to do it
Launch JSCAPE MFT Server Manager, go to the Triggers module and click the Add button.
Give the trigger a name (e.g. "Download Only Txt Files") and select Current Time from the Event type drop-down list. Click Next.
Click the Time Expression button.
Specify the time when you want the file transfer to execute. Notice that you can specify the hour, minute, day, week, month, or year. In other words, you can schedule the file transfer to run regularly on a specific minute, hour, day, week, month, etc.
In our example, we'd like our file transfer to run at 9:30 PM every Friday. To do that, we simply enter 21 (based on a 24-hour clock) in the Hour field, 30 in the Minute field, and 5 (where Monday is counted as day 1) in the DayOfWeek field. Click OK when done.
JSCAPE MFT Server will then automatically generate an expression based on those settings. Click Next to proceed.
On the succeeding screen, click the Add button to add a trigger action.
Next, select [protocol] Regex File Download from the Action drop-down list. Since we're using the FTPS service for this example, we select FTPS Regex File Download. You can also find regex file download trigger actions for other file transfer protocols like FTP, SFTP, AFTP, and AFTP, so select the action that matches your protocol.
Enter all pertinent information into their respective fields. It's assumed that you have a remote file transfer server to connect to and that you already have a working user account on that server. The required fields are:
✔ Port number of the protocol,
✔ Timeout value,
✔ Username of the account you'll use to login to the remote server,
✔ the corresponding Password of that account,
✔ the Connection type for the protocol you're using (e.g. Auth TLS, Auth SSL, or Implicit SSL for FTPS),
✔ the Regular Expression (regex) to match when selecting the files to download,
✔ the Remote Directory where the files you want to download are located,
✔ the Local Directory where you want to store the downloaded files, and
✔ the Transfer Mode (binary, auto, or ascii)
The regular expression we're using for this example is quite basic. You can enter more sophisticated regular expressions if you want. Not familiar with regular expressions? Not a problem. These articles should get you up to speed:
Review your settings and then click OK.
You should then see your newly created trigger action. Click OK.
As soon as you're back at the main screen, you should see your newly created trigger. To complete the trigger creation process, click the Apply button.
That's it. If you want to try this out yourself, you can download the free evaluation edition of JSCAPE MFT Server. Just click the download link below.