| File Pre- and Post-Processing (Prepost) |
91
This file runs the Perl script
aspera-notif.pl
, which is an email notification script that sends emails
(according to user-defined filters) to one or more recipients. Filters and lists are defined in the Aspera
configuration file
aspera.conf
, which is located in
/opt/aspera/etc
.
Copy the contents of
aspera-prepost.disable
into a new file, and name it as follows:
/opt/aspera/var/aspera-prepost
Ensure that execute privileges are enabled (at least
r-xr-xr-x
).
2.
Create your scripts.
The pre/post processing script,
aspera-prepost
, can contain the pre/post processing steps, as well as execute
other programs. Often,
aspera-prepost
checks for certain conditions (based on environment variables), and
then calls a specific external executable based on those conditions.
aspera-prepost
is executed as a result of a the start and end of a transfer session, as well as the start and end
of the transfer of an individual file in the session. Use the variables
TYPE
and
STARTSTOP
to specify a particular
state. For the complete list of all variables, see
on page 91.
3.
Include custom scripts in
aspera-prepost
.
Custom scripts can be written directly into the script file
aspera-prepost
. For example, to add the custom
script
script1.pl
to your pre/post script, insert the following line (into
aspera-prepost
):
...
perl script1.pl
...
Pre/Post Variables
HST Server supports an extensive set of variables that can be used in prepost scripts.
Note:
The "File Pre- and Post-Processing (Prepost)" feature will be deprecated from HST Server and HST Endpoint
in versions 4.0 and onward. At that time, customers should use Inline File validation with Lua (
on page 87) or an External URL validator (
Out-of-Transfer File Validation
on page 80) for
pre-post processing features.
The following tables list all pre/post variables for setting up pre- and post-processing. Some can be applied only to
sessions, some only to files, and some to both sessions and files.
Pre/post variable considerations:
• Pre/post variables are case-sensitive.
• Pre/post variables that can be arbitrarily long (values marked with * below) are truncated by prepost scripts.
For Sessions and Files
Variable
Description
Values
Example
COOKIE
The user-defined cookie string.
string*
"$COOKIE" == cookie-string
DIRECTION
The transfer direction.
• send
• recv
"$DIRECTION" == send
ERRCODE
The error code.
string
"$ERRCODE" == 1
ERRSTR
The error string.
string
"$ERRSTR" == FASP error
MANIFESTFILE
The full path to the manifest file.
string*
"$MANIFESTFILE" == /log