| Configure the Server from the Command Line |
71
Run the following command to confirm that the XML is correctly formatted and the parameter settings are valid:
# /opt/aspera/bin/asuserdata -v
aspera.conf - Filters to Include and Exclude Files
Filters refine the list of source files (or directories) to transfer by indicating which to skip or include based on name
matching. When no filtering rules are specified by the client, Ascp transfers all source files in the transfer list; servers
cannot filter client uploads or downloads.
Filters can be specified on the
ascp
command line and in
aspera.conf
. Ascp applies filtering rules that are set in
aspera.conf
before
it applies rules on the command line.
The
ascp -N
and
-E
options let you specify filter rules individually for each transfer, while filter options
configured in
aspera.conf
allow you to have the same rules applied to all transfers.
Filter rules that
ascp
finds in
aspera.conf
are always applied before any command-line rules. This allows you to
specify individual command-line rules to augment a core set specified in
aspera.conf
.
Rule Syntax
A rule consists of a "
+
" or "
-
" sign (indicating whether to include or exclude), followed by a space character,
followed by a pattern. A pattern can be a file or directory name, or a set of names expressed with UNIX
glob
patterns.
Basic usage
• Filtering rules are applied to the transfer list in the order that they are listed in
aspera.conf
.
• Filtering is a process of exclusion, and include rules override exclude rules that follow them. Include rules cannot
add back files that are excluded by a preceding exclude rule.
• Include rules must be followed by at least one exclude rule, otherwise all files are transferred because none are
excluded. To exclude all unmatched files, add two final rules: "
- *
" and "
- .*
".
• Filtering operates only on the set of files and directories in the transfer list. An include rule cannot add files or
directories that are not already part of the transfer list.
Example
Transfer Result
-
rule
Transfer all files and directories except those with names that match
rule
.
+
rule
Transfer all files and directories because none are excluded.
+
rule1
-
rule2
Transfer all files and directories with names that match
rule1
, as well as all other files
and directories except those with names that match
rule2
.
-
rule1
+
rule2
Transfer all files and directories except those with names that match
rule1
. All files
and directories not already excluded by
rule1
are included because no additional
exclude rule follows
-N '
rule2
'
. Additional filters can be set for transfers in the
GUI (
Adding and Editing Connections
) or on the command line (
on page 126).
Filtering Rule Application
Filtering order
Filtering rules are applied to the transfer list in the order they appear in the list.
1.
The first file (or directory) in the transfer list is compared to the pattern of the first rule.
2.
If the file matches the pattern, Ascp includes it or excludes it and the file is immune to any following rules.