| File Pre- and Post-Processing (Prepost) |
90
•
as_dbg2
•
as_dbg3
•
as_dbg4
To use the
ascp
log functions in your Lua script, replace
as
with
lua
.
Miscellaneous Lua Interfaces
•
lua_override_ear_secret("
secret
")
Override the server-side encryption-at-rest (EAR) secret that is set in
aspera.conf
with the specified secret.
File Pre- and Post-Processing (Prepost)
HST Server can run file processing scripts that run before or after a transfer session or file transfer.
Setting Up Pre/Post Processing
HST Server can be configured to run scripts that are triggered by session start, session stop, file start, and file stop.
Important:
The "File Pre- and Post-Processing (Prepost)" feature is deprecated and will be removed from HST
File Validation with Lua Script
on page 87) or an External URL validator (
Out-of-Transfer File Validation
on
page 80) for pre-post processing features.
Your Aspera server can automatically execute a
shell
script from a pre-defined location:
/opt/aspera/var/
The script is executed as a result of four transfer events:
• Session start
• Session end
• Start of each individual file transfer in the session
• End of each individual file transfer in the session
The
aspera-prepost
script can also execute additional shell scripts, Perl scripts, native executables, and Java
programs.
Environment Variables:
Aspera has several environment variables for
aspera-prepost
that you can use in
your own custom scripts. These environment variables are described in detail in
on page 91.
Depending on usage, pre- and post-processing may consume a large amount of system resources. Be sure to evaluate
your system performance and apply this feature appropriately.
CAUTION:
When creating pre- and post-processing scripts, unsafe scripts can compromise a server. As with
CGI scripts, you should take precautions in testing a pre/post script before placing it into use (such as taint
checking and ensuring proper quotes). You should also be aware of user permissions; pre/post scripts run as
the user who authenticates the transfer. To prevent a pre/post script from performing an action with elevated
or special user permissions, the script needs to check the
$USER
variable.
To set up pre/post processing for your Aspera transfer product:
1.
Set up the shell script file.
Locate the following file:
/opt/aspera/var/aspera-prepost.disable