Transfer session data accessible to scripts

When a Lua script is started, data about the transfer session is automatically written to the ( env_table[]) table. You can access and modify the values in the table with your scripts by using the table index names.

For example, this call changes the file name that is stored in env_table["file"] to C:\tmp\foo_new_name:
lua_rename(env_table["file"],"C:\tmp\foo_new_name")

Session start

env_table[] Index Description Value
cipher Encryption cipher for file data, which is defined with aspera.conf or with ascp (if both are set, the aspera.conf setting overrides ascp) cipher_name or none
cookie The cookie sent to the client system user_def_cookie_string
dest Destination path name commandline_dest_param
direction Direction of transfer send or receive
file_name_encoding File encoding Currently, only UTF-8 is used
local_ip Local IP address local_IP_address
min_rate_kbps The initial minimum rate, in Kbps initial_minimum_rate_kbps
peer_ip Peer name or IP address peer_name_or_IP_address
rate Effective rate in Kbps effective_rate_in_kbps
rate_policy Defines the ascp rate policy. If not defined here, the value is taken from the default configuration in the GUI or aspera.conf fixed,high,fair, or low
session_id Session ID session_id
source Source-file path name truncated_source_listing
startstop Session start or session stop, based on the event type value start
target_rate_kbps The maximum target rate for transfers, in Kbps target_rate_value_kbps
transport Transport mechanism; either Ascp or Ascp4 ascp or ascp4
type Event type Session
user Username user_name
userid User ID user_id
version Ascp or Ascp4 version number ascp_version or ascp4_version
xfer_id Transfer UUID transfer_uuid

Session stop

env_table[] Index Description Value
cipher Encryption cipher for file data, which is defined with aspera.conf or with ascp (if both are set, the aspera.conf setting overrides ascp) cipher_name or none
cookie The cookie sent to the client system user_def_cookie_string
dest Destination path name commandline_dest_param
direction Direction of transfer send or receive
elapsed_usec

Running time of the transfer in microseconds

errcode Error code error_code
error Error string associated with the error code error_string
file_bytes Total number of bytes written to disk total_bytes_written
file_name_encoding File encoding Currently, only UTF-8 is used
filecount

Number of files

number_of_files
local_ip Local IP address local_IP_address
loss Measured network loss measured_network_loss
min_rate_kbps The initial minimum rate, in Kbps initial_minimum_rate_kbps
peer_ip Peer name or IP address peer_name_or_IP_address
rate Effective rate in Kbps effective_rate_in_kbps
rate_policy Defines the ascp rate policy. If not defined here, the value is taken from the default configuration in the GUI or aspera.conf fixed,high,fair, or low
session_id Session ID session_id
source Source-file path name truncated_source_listing
startstop Session start or session stop, based on the event type value stop
target_rate_kbps The maximum target rate for transfers, in Kbps target_rate_value_kbps
transfer_bytes Total number of bytes transferred total_bytes_transferred
transport Transport mechanism; either Ascp or Ascp4 ascp or ascp4
type Event type Session
user Username user_name
userid User ID user_id
version Ascp or Ascp4 version number ascp_version or ascp4_version
xfer_id Transfer UUID transfer_uuid

File Start

env_table[] Index Description Value
cipher Encryption cipher for file data, which is defined with aspera.conf or with ascp (if both are set, the aspera.conf setting overrides ascp) cipher_name or none
delay Measured network delay measured_network_delay
dest Destination path name commandline_dest_param
direction Direction of transfer send or receive
elapsed_usec

Running time of the transfer in microseconds

end_byte

The end byte, always 0 unless the range option is used

errcode Error code error_code
file Full path name to file being validated file_path
file_bytes Total number of bytes written to disk total_bytes_written
file_csum File checksum hash_of_file_contents
file_csum_type File checksum type none or md5 or sha1 or sha256 or sha384 or sha512
file_name_encoding File encoding Currently, only UTF-8 is used
local_ip Local IP address local_IP_address
loss Measured network loss measured_network_loss
min_rate_kbps The initial minimum rate, in Kbps initial_minimum_rate_kbps
peer_ip Peer name or IP address peer_name_or_IP_address
rate Effective rate in Kbps effective_rate_in_kbps
rate_policy Defines the ascp rate policy. If not defined here, the value is taken from the default configuration in the GUI or aspera.conf fixed,high,fair, or low
session_id Session ID session_id
size File size, in bytes file_size_in_bytes
source Source-file path name truncated_source_listing
start_byte Start byte, if resumed start_byte_if_resumed, lower range
startstop Session start or session stop, based on the event type value start
state Transfer state started, success, or failed
target_rate_kbps The maximum target rate for transfers, in Kbps target_rate_value_kbps
transfer_bytes Total number of bytes transferred total_bytes_transferred
transport Transport mechanism; either Ascp or Ascp4 ascp or ascp4
type Event type Transfer
user Username user_name
userid User ID user_id
version Ascp or Ascp4 version number ascp_version or ascp4_version
xfer_id Transfer UUID transfer_uuid

File Stop

env_table[] Index Description Value
cipher Encryption cipher for file data, which is defined with aspera.conf or with ascp (if both are set, the aspera.conf setting overrides ascp) cipher_name or none
delay Measured network delay measured_network_delay
dest Destination path name commandline_dest_param
direction Direction of transfer send or receive
elapsed_usec

Running time of the transfer in microseconds

end_byte

The end byte, always 0 unless the range option is used

errcode Error code error_code
error Error string associated with the error code error_string
file Full path name to file being validated file_path
file_bytes Total number of bytes written to disk total_bytes_written
file_csum File checksum hash_of_file_contents
file_csum_type File checksum type none or md5 or sha1 or sha256 or sha384 or sha512
file_name_encoding File encoding Currently, only UTF-8 is used
local_ip Local IP address local_IP_address
loss Measured network loss measured_network_loss
min_rate_kbps The initial minimum rate, in Kbps initial_minimum_rate_kbps
peer_ip Peer name or IP address peer_name_or_IP_address
rate Effective rate in Kbps effective_rate_in_kbps
rate_policy Defines the ascp rate policy. If not defined here, the value is taken from the default configuration in the GUI or aspera.conf fixed,high,fair, or low
session_id Session ID session_id
size

File size, in bytes

file_size_in_bytes
source Source-file path name truncated_source_listing
start_byte Start byte, if resumed start_byte_if_resumed, lower range
startstop Session start or session stop, based on the event type value stop
state Transfer state started, success, or failed
target_rate_kbps The maximum target rate for transfers, in Kbps target_rate_value_kbps
transfer_bytes Total number of bytes transferred total_bytes_transferred
transport Transport mechanism; either Ascp or Ascp4 ascp or ascp4
type Event type Transfer
user Username user_name
userid User ID user_id
version Ascp or Ascp4 version number ascp_version or ascp4_version
xfer_id Transfer UUID transfer_uuid

Session Progress

env_table[] Index Description Value
cipher Encryption cipher for file data, which is defined with aspera.conf or with ascp (if both are set, the aspera.conf setting overrides ascp) cipher_name or none
delay Measured network delay measured_network_delay
dest Destination path name commandline_dest_param
direction Direction of transfer send or receive
elapsed_usec

Running time of the transfer in microseconds

end_byte

The end byte, always 0 unless the range option is used

errcode Error code error_code
file

Full path name to file being validated

file_path
file_bytes Total number of bytes written to disk total_bytes_written
file_csum File checksum hash_of_file_contents
file_csum_type File checksum type none or md5 or sha1 or sha256 or sha384 or sha512
file_name_encoding File encoding Currently, only UTF-8 is used
local_ip Local IP address local_IP_address
loss Measured network loss measured_network_loss
min_rate_kbps The initial minimum rate, in Kbps initial_minimum_rate_kbps
peer_ip Peer name or IP address peer_name_or_IP_address
rate Effective rate in Kbps effective_rate_in_kbps
rate_policy Defines the ascp rate policy. If not defined here, the value is taken from the default configuration in the GUI or aspera.conf fixed,high,fair, or low
session_id Session ID session_id
size File size, in bytes file_size_in_bytes
source Source-file path name truncated_source_listing
start_byte Start byte, if resumed start_byte_if_resumed, lower range
startstop Session start or session stop, based on the event type value Running for session in progress
state Transfer state started, success, or failed
target_rate_kbps The maximum target rate for transfers, in Kbps target_rate_value_kbps
transfer_bytes Total number of bytes transferred total_bytes_transferred
transport Transport mechanism; either Ascp or Ascp4 ascp or ascp4
type Event type Session
user Username user_name
userid User ID user_id
version Ascp or Ascp4 version number ascp_version or ascp4_version
xfer_id Transfer UUID transfer_uuid

Return values

When a Lua script exits, Lua returns either LRET_OK or LRET_ERROR (followed by an error number or descriptive string.