Last active
June 30, 2019 19:06
-
-
Save gnomeria/650a90940f4e2c7346ca5aa184f78fdb to your computer and use it in GitHub Desktop.
ECMWF Precipitation 1 Hour - S3 Shell Script Downloader With Aria2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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