Scheduling an Automated File Transfer for Files Matching a Regex

Learn how to set up a scheduled automated file transfer affecting files that match a regular expression.
  1. Blog

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 the JSCAPE MFT Server Manage. Now, go to Domains, select the domain where you want to add the trigger, and click Edit.

scheduling automated file transfers for files matching a regex 01

Next, go to the Triggers module and click the Add button.

scheduling automated file transfers for files matching a regex 02

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

scheduling automated file transfers for files matching a regex 03

Once you're inside the Trigger Conditions dialog, click the Time Expression button.

scheduling automated file transfers for files matching a regex 04

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. You can also enter multiple, comma-separated values. Click OK when done.

scheduling automated file transfers for files matching a regex 05

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

scheduling automated file transfers for files matching a regex 06

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

scheduling automated file transfers for files matching a regex 07

Next, select one of the Regex File Download actions 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.

scheduling automated file transfers for files matching a regex 08

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)

Note:

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.

scheduling automated file transfers for files matching a regex 09

scheduling automated file transfers for files matching a regex 10

You should then see your newly created trigger action among your list of trigger actions for this particular trigger. Click OK.

scheduling automated file transfers for files matching a regex 11

As soon as you're back at the main screen, you should see your newly created trigger.

scheduling automated file transfers for files matching a regex 12

That's it. If you want to try this out yourself, you can download the FREE Starter Edition of JSCAPE MFT Server. Just click the download link below.

Recommended Download

Download JSCAPE MFT Server Trial