From 1005dcf6a786f691665ba95142f68ab838dc27d9 Mon Sep 17 00:00:00 2001 From: Mohammad Mohseni Aref Date: Thu, 20 Dec 2018 20:18:41 +0100 Subject: [PATCH 1/2] Update get_ecmwf fix a bug, It is working fine now! --- bin/get_ecmwf | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/bin/get_ecmwf b/bin/get_ecmwf index 13869de..66788ec 100755 --- a/bin/get_ecmwf +++ b/bin/get_ecmwf @@ -37,7 +37,7 @@ fi password=$1 username=$2 filelist=$3 - +maindirectory=$(pwd) echo $curdir for f in `cat $filelist` do @@ -47,13 +47,17 @@ do year=`echo $f | gawk 'BEGIN {FS="/"} {print substr($(NF),5,4)}'` ftp_link=ftp://ftp.ceda.ac.uk/badc/ecmwf-era-interim/data/gg/ap/$year/$month/$day/$f - - echo $day -file=${f} -mkdir $date -cd $date + +# make the director for specifc date if it didn't exist! + if [ ! -d "$date" ] ; then + mkdir $date + fi + + cd $date echo $file ncftpget -u $username -p $password $ftp_link + cd $maindirectory + done From df3e109765a6eadf553058b6a83c28809a571d99 Mon Sep 17 00:00:00 2001 From: Mohammad Mohseni Aref Date: Thu, 3 Jan 2019 19:05:00 +0100 Subject: [PATCH 2/2] Update get_ecmwf --- bin/get_ecmwf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/get_ecmwf b/bin/get_ecmwf index 66788ec..ee19cac 100755 --- a/bin/get_ecmwf +++ b/bin/get_ecmwf @@ -37,7 +37,7 @@ fi password=$1 username=$2 filelist=$3 -maindirectory=$(pwd) + echo $curdir for f in `cat $filelist` do @@ -56,7 +56,7 @@ ftp_link=ftp://ftp.ceda.ac.uk/badc/ecmwf-era-interim/data/gg/ap/$year/$month/$da cd $date echo $file ncftpget -u $username -p $password $ftp_link - cd $maindirectory + cd .. done