Managed File Transfer and Network Solutions

Scheduling an Automated File Transfer for Files Matching a Regex

Posted by John Carl Villanueva on Fri, Aug 22, 2014 @ 04:18 PM



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


scheduling automated file transfers regex resized 600


Find it interesting? Learn how to do it

Launch JSCAPE MFT Server Manager, go to the Triggers module and click the Add button.


01 mft server add trigger resized 600


Give the trigger a name (e.g. "Download Only Txt Files") and select Current Time from the Event type drop-down list. Click Next.


02 mft server trigger event current time resized 600


Click the Time Expression button.


03 mft server trigger condition time expression resized 600


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.


04 mft server trigger condition time expression parameters resized 600


JSCAPE MFT Server will then automatically generate an expression based on those settings. Click Next to proceed.


05 mft server trigger condition with time values resized 600


On the succeeding screen, click the Add button to add a trigger action.


06 mft server trigger action add resized 600


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. 


07 mft server ftps regex file download resized 600


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:

✔ Hostname,

✔ 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:

Using Regular Expressions in Triggers - Part 1

Using Regular Expressions in Triggers - Part 2

Exploring Regular Expressions in DLP


Review your settings and then click OK.


08 mft server ftps regex file download parameters resized 600


You should then see your newly created trigger action. Click OK


09 mft server ftps regex file download new resized 600


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.


10 mft server new download only txt files trigger resized 600


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.


Recommended Download


Download Now


Topics: JSCAPE MFT Server, Managed File Transfer, Business Process Automation, Tutorials, Triggers, FTPS, regular expressions