Skip to content

Instantly share code, notes, and snippets.

@smhr
Last active October 12, 2022 03:37
Show Gist options
  • Save smhr/5e90292248d0cf6b0d8ec2963b0e7724 to your computer and use it in GitHub Desktop.
Save smhr/5e90292248d0cf6b0d8ec2963b0e7724 to your computer and use it in GitHub Desktop.
sha256sum -c checksums.txt &> check.log &
## then to find bad files:
cat check.log | grep FA | awk -F. '{print $2}' > FAILED_CHECKSUM
# inpot: snap_099.92.hdf5: FAILED
# output: 92
# then run (for TNG100-1)
while read snapN
do
echo " ============= Downloading : ${snapN} "
wget --no-check-certificate --content-disposition --header="API-Key: your_key" "http://www.tng-project.org/api/TNG100-1/files/snapshot-99.${snapN}.hdf5"
done < FAILED_CHECKSUM
echo "Calculating checksums ..."
sha256sum -c checksums.txt &> check.log
## then to find bad files:
cat check.log | grep FA | awk -F. '{print $2}' > FAILED_CHECKSUM
echo "$(wc -l FAILED_CHECKSUM) found"
while read Name
do
echo " ============= Downloading : ${Name} "
wget --no-check-certificate --content-disposition --header="API-Key: your_key" "http://www.tng-project.org/api/TNG50-1/files/groupcat-50.${Name}.hdf5"
done < FAILED_CHECKSUM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment