Enabling from aspera.conf
Open the aspera.conf file on your server and add the <file_checksum> option to the <file_system> section, as follows. Valid settings are as follows:
- md5 - Calculate and report an MD5 checksum.
- sha1 - Calculate and report an SHA-1 checksum.
- any - Allow the checksum format to be whichever format the client requests.
<file_system> ... <file_checksum>md5</file_system> ... </file_system>
Enabling from the GUI
Click Configuration to open the Server Configuration window. Select the Global, Groups, or Users tab, depending on whether you want to configure checksum reporting for all users, or for a particular group or user. Under the File Handling tab, locate the setting for File checksum method. Check the override box and for the effective value, select md5, sha1, or any.
To obtain the checksum values from file transfers, you can configure the file manifest, or you can set up a pre/post-processing script to report the values.
Enabling and configuring the file manifest
In the aspera.conf file where you originally set the <file_checksum> option, add settings for <file_manifest> and <file_manifest_path>; for example:
<file_system> ... <file_checksum>md5</file_system> <file_manifest>text</file_manifest> <file_manifest_path>/tmp</file_manifest_path> ... </file_system>
Alternatively, from the GUI, go to the File Handling tab on the Server Configuration page where you originally enabled checksum reporting.
Locate the File Manifest setting. Check the override box and set the effective value to text.
Locate the File Manifest Path setting on the line just below. Check the override box and set the effective value to a folder where the manifest files are to be saved.
In the above examples, when files are transferred, the manifest is generated to a text file called aspera-transfer-transfer_id-manifest.txt in the directory /tmp.
Setting up a Pre/Post-processing Script
The checksum of a successfully transferred file is stored in the pre/post environment variable FILE_CSUM. This environment variable can be used in pre/post scripts to capture file checksums. For example, the following script outputs the checksum to the file /tmp/cksum.log:
#!/bin/bash if [ $TYPE == File ]; then if [ $STARTSTOP == Stop ]; then echo "The file is: $FILE" >> /tmp/cksum.log echo "The file checksum is: $FILE_CSUM" >> /tmp/cksum.log chmod 777 $FILE fi fi
For information on how to set up pre- and post-processing scripts such as the above and how to use builtin pre/post environment variables, see Pre- and Post-Processing (Prepost).