
Transferring files - either from one server to another or just from one directory
to another - may be the most basic step of any software deployment. BuildMaster's
Transfer Files action is a simple concept with a lot of power. In this article,
we'll take a look at some of the ways to use BuildMaster's file masking rules to
include or exclude certain files from the transfer action.
The Transfer Files Action
Before talking about masking, let's take a look at the Transfer Files action editor
itself.

The Source and Target fields allow you to specify
source and target servers/directories (naturally); in this example I'll be using
C:\TransferFilesDemo\Source and C:\TransferFilesDemo\Target on
the same server for demonstration purposes.
In the Files/Folder Mask field, you can provide masking rules that
will tell BuildMaster which files to include or exclude. By default, all files and
subdirectories are included with the * mask. The Delete files/directories
not present in source option does exactly what it says: if a file is
detected in the target that was not in the source, it will be deleted; this makes
it possible to mirror a target directory to match a source.
Masking Examples
To illustrate BuildMaster's masking rules, let's consider some examples. Consider
that for all examples, the Target directory is empty, and the
Source directory contains the following files and folders:
BigDoc.pdf
Documentation.pdf
WordDoc.docx
WordDoc 2.docx
TextFile1.txt
TextFile2.txt
Subfolder\BigDoc in subfolder.pdf
Subfolder\WordDoc in subfolder.docx
The following table provides some examples of masking on this set of files.
Mask | Files Transferred | Description |
*.docx
*.pdf | BigDoc.pdf
Documentation.pdfWordDoc.docx
WordDoc 2.docx
Subfolder\BigDoc in subfolder.pdf
Subfolder\WordDoc in subfolder.docx |
All .docx and .pdf files are transferred; every other file is skipped.
|
*
!*.docx | BigDoc.pdf
Documentation.pdfTextFile1.txt
TextFile2.txt
Subfolder\BigDoc in subfolder.pdf |
All files except .docx files are transferred.
|
*.docx
!Subfolder\* | WordDoc.docx
WordDoc 2.docx |
All .docx files except anything in Subfolder
|
*
!*Doc* | TextFile1.txt
TextFile2.txtSubfolder\ |
All files and folders except those with Doc in them are transferred.
|
Other Uses for Masks
In addition to the Transfer Files action, you can use File Masking in any action
editor that says it is supported. For example, the Delete Files
action allows you to specify files to delete using the same masking rules.