| Configure the Server from the Command Line |
77
For example:
# ascp --file-checksum=md5 --file-manifest=text --file-manifest-path=/
tmp
file
aspera_user_1@189.0.202.39:/
destination_path
Setting up a Pre/Post-processing Script
An alternative to enabling and configuring the file manifest to collect checksum reporting is to set up a pre/post-
processing script to report the values.
The checksum of a transferred file is stored in the pre/post environment variable
FILE_CSUM
, which can be used in
pre/post scripts to output 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 pre- and post-processing scripts and environment variables, see
on page 90.
Comparing Checksums
If you open a file that you downloaded with Aspera and find that it is corrupted, you can determine when the
corruption occurred by comparing the checksum that is reported by Aspera to the checksums of the files on the
destination and on the source.
1.
Retrieve the checksum that was calculated by Aspera as the file was transferred.
• If you specified a file manifest and file manifest path as part of an
ascp
transfer or pre/post processing script,
the checksums are in that file in the specified location.
• If you specified a file manifest and file manifest path in the GUI or
aspera.conf
, the checksums are in a
file that is named
aspera-transfer-transfer_id-manifest.txt
in the specified location.
2.
Calculate the checksum of the corrupted file. This example uses the MD5 checksum method; replace MD5 with
the appropriate checksum method if you use a different one.
# md5sum
filepath
3.
Compare the checksum reported by Aspera with the checksum that you calculated for the corrupted file.
• If they do not match, then corruption occurred as the file was written to the destination. Download the file
again and confirm that it is not corrupted. If it is corrupted, compare the checksums again. If they do not
match, investigate the write process or attempt another download. If they match, continue to the next step.
• If they match, then corruption might have occurred as the file was read from the source. Continue to the next
step.
4.
Calculate the checksums for the file on the source. These examples use the MD5 checksum method; replace MD5
with the appropriate checksum method if you use a different one.
Windows:
> CertUtil -hashfile
filepath
MD5