I am writing a python script to download all files in a directory.
Example indir
:
https://data.chc.ucsb.edu/products/EWX/data/forecasts/CHIRPS-GEFS_precip_v12/daily_16day/2016/01/02
This directory is programmatically generated in my loop due to a specific reason.
tmptime=stime
while tmptime < etime:
tmptime = tmptime + timedelta(days=1) # increase timestamp daily
tmppath = os.path.join(str(tmptime.year), str(tmptime.strftime("%m")), str(tmptime.strftime("%d")))
indirtmp = os.path.join(indir, tmppath)
outdir = os.path.join(outdir, tmppath)
Now, how can I download all files in that link and move to another directory outdir
I have created in my script? I am okay with a library or offloading it to a linux process.
I will basically be doing this for 20 years every day.