I am trying to download these files from ftp server 'data-out.unavco.org'. These are the files (out of 329 of these files, i only listed 3): ftp://data-out.unavco.org/pub/rinex/obs/2015/001/adis0010.15d.Z, ftp://data-out.unavco.org/pub/rinex/obs/2015/002/adis0020.15d.Z, ftp://data-out.unavco.org/pub/rinex/obs/2015/003/adis0030.15d.Z
I only know how to download just one, please how do i loop the whole 329 files or directories.
Here is what i tried for just one file or directory: and it downloads the file adis0010.15d.Z. I dont know how to use the import os or other methods. I need two things: batch input the 329 paths and batch input the 329 filenames.
import ftplib
ftp=ftplib.FTP('data-out.unavco.org')
ftp.login()
path='/pub/rinex/obs/2015/001/'
ftp.cwd(path)
filename = "adis0010.15d.Z"
with open(filename, "wb") as file:
# use FTP's RETR command to download the file
ftp.retrbinary(f"RETR {filename}", file.write)
ftp.quit()