Changeset 203 for trunk/src/get_swr.sh
- Timestamp:
- 02/11/14 18:41:24 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/get_swr.sh
r199 r203 13 13 # ======== 14 14 # 15 # ::16 # 17 # $get_swr.sh15 # .. code-block:: bash 16 # 17 # get_swr.sh 18 18 # 19 19 # DESCRIPTION … … 45 45 # ======== 46 46 # 47 # You don't have any RAMA reference data, you just have to run this tool :: 48 # 49 # $ get_swr.sh 50 # 51 # And look at log file with :: 52 # 53 # $ tlogd.sh get_swr 47 # You don't have any RAMA reference data, you just have to run this tool : 48 # 49 # .. code-block:: bash 50 # 51 # get_swr.sh 52 # 53 # And look at log file with : 54 # 55 # .. code-block:: bash 56 # 57 # tlogd.sh get_swr 54 58 # 55 59 # and of course on files in ${PROJECT_ID}. … … 92 96 system=$(uname) 93 97 case "${system}" in 94 AIX|IRIX64)95 echo "www : no specific posix checking"96 date_cmd=date97 ;;98 Darwin)99 set -o posix100 date_cmd=gdate101 ;;102 Linux)103 set -o posix104 date_cmd=date105 ;;106 *)107 set -o posix108 ;;98 AIX|IRIX64) 99 echo "www : no specific posix checking" 100 date_cmd=date 101 ;; 102 Darwin) 103 set -o posix 104 date_cmd=gdate 105 ;; 106 Linux) 107 set -o posix 108 date_cmd=date 109 ;; 110 *) 111 set -o posix 112 ;; 109 113 esac 110 114 unset system … … 130 134 if [ ${status} -ne 0 ] 131 135 then 132 echo "${command} : eee : tool ${tool} not found"133 exit 1136 echo "${command} : eee : tool ${tool} not found" 137 exit 1 134 138 fi 135 139 unset status … … 139 143 if [ "${PROJECT_LOG}" = "" ] 140 144 then 141 echo "${command} : eee : \${PROJECT_LOG} not defined"142 exit 1145 echo "${command} : eee : \${PROJECT_LOG} not defined" 146 exit 1 143 147 fi 144 148 # … … 146 150 if [ ! -d ${PROJECT_LOG} ] 147 151 then 148 echo "${command} : eee : ${PROJECT_LOG} not found"149 exit 1152 echo "${command} : eee : ${PROJECT_LOG} not found" 153 exit 1 150 154 fi 151 155 # … … 153 157 if [ ! -x ${PROJECT_LOG} ] 154 158 then 155 echo "${command} : eee : ${PROJECT_LOG} not reachable"156 exit 1159 echo "${command} : eee : ${PROJECT_LOG} not reachable" 160 exit 1 157 161 fi 158 162 # … … 160 164 if [ ! -w ${PROJECT_LOG} ] 161 165 then 162 echo "${command} : eee : ${PROJECT_LOG} not writable"163 exit 1166 echo "${command} : eee : ${PROJECT_LOG} not writable" 167 exit 1 164 168 fi 165 169 # … … 186 190 while [ ${yyyy} -le ${yearmax} ] 187 191 do 188 for var in ${varlist}189 do190 list_url="${list_url} ${locref}/${var}_isccp_${yyyy}.nc.gz"191 done192 unset var193 yyyy=$(( ${yyyy} + 1 ))192 for var in ${varlist} 193 do 194 list_url="${list_url} ${locref}/${var}_isccp_${yyyy}.nc.gz" 195 done 196 unset var 197 yyyy=$(( ${yyyy} + 1 )) 194 198 done 195 199 unset varlist … … 199 203 for url in ${list_url} 200 204 do 201 file_gz=${PROJECT_ID}/$(basename ${url})202 file=${PROJECT_ID}/$(basename ${file_gz} .gz)203 if [ ! -f ${file} ]204 then205 if [ ! -f ${file_gz} ]206 then207 wget --tries=1 --no-verbose -P ${PROJECT_ID} \205 file_gz=${PROJECT_ID}/$(basename ${url}) 206 file=${PROJECT_ID}/$(basename ${file_gz} .gz) 207 if [ ! -f ${file} ] 208 then 209 if [ ! -f ${file_gz} ] 210 then 211 wget --tries=1 --no-verbose -P ${PROJECT_ID} \ 208 212 ${url} >> ${log} 2>&1 209 wget_status=${?}210 if [ ${wget_status} -ne 0 ]211 then212 echo "${command} : eee : ${url} not found" >> ${log} 2>&1213 # ++ exit 1214 else215 echo "${command} : iii : ${url} found" >> ${log} 2>&1216 fi217 unset wget_status218 else219 echo "iii : ${file_gz} exists" >> ${log}220 gunzip -c ${file_gz} > ${file}221 fi222 else223 echo "iii : ${file} exists" >> ${log}224 fi213 wget_status=${?} 214 if [ ${wget_status} -ne 0 ] 215 then 216 echo "${command} : eee : ${url} not found" >> ${log} 2>&1 217 # ++ exit 1 218 else 219 echo "${command} : iii : ${url} found" >> ${log} 2>&1 220 fi 221 unset wget_status 222 else 223 echo "iii : ${file_gz} exists" >> ${log} 224 gunzip -c ${file_gz} > ${file} 225 fi 226 else 227 echo "iii : ${file} exists" >> ${log} 228 fi 225 229 done 226 230 unset file_gz
Note: See TracChangeset
for help on using the changeset viewer.