= Download script for Argo data = {{{#!python #!/usr/bin/env python import os,os.path from ftplib import FTP tmp_dir='/scratch/clisap/seaice/TMP/u242023/ARGO/' ftp_adr='ftp.ifremer.fr' ftp_dir='/ifremer/argo/geo/atlantic_ocean/2011/01/' ftp = FTP(ftp_adr) # connect to host, default port ftp.login() # user anonymous, passwd anonymous@ ftp.cwd(ftp_dir) file_list=ftp.nlst() for f in file_list: urlfile='ftp://'+ftp_adr+ftp_dir+f localfile=tmp_dir+f if not(os.path.exists(localfile)): print 'Getting file '+f #We use curl instead of ftp.retrbinary for download os.system("curl -s -k -o "+localfile+" "+urlfile) else: print 'file '+f+' exists' ftp.close() }}}