Skip to content

Instantly share code, notes, and snippets.

@gnomeria
Last active June 30, 2019 19:06
Show Gist options
  • Save gnomeria/650a90940f4e2c7346ca5aa184f78fdb to your computer and use it in GitHub Desktop.
Save gnomeria/650a90940f4e2c7346ca5aa184f78fdb to your computer and use it in GitHub Desktop.
ECMWF Precipitation 1 Hour - S3 Shell Script Downloader With Aria2
#!/bin/bash
type=$1
startY=$(($2))
endY=$(($3))
# trap ctrl-c and call ctrl_c()
trap ctrl_c INT
function ctrl_c() {
echo "CANCELLED"
exit -1
}
for((year=$startY;year<=$endY;year++)); do
for m in {1..12}
do
url="http://era5-pds.s3.amazonaws.com/"$year/`printf %02d $m`/data/precipitation_amount_1hour_Accumulation.nc
filename="precip_1_hour_"$year"_"$m".nc"
echo "filename: " $filename
echo "Downloading url: " $url
aria2c -x10 -o $filename $url
echo "url: " $url
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment