Changeset 719 for trunk/libIGCM/libIGCM_sys/libIGCM_sys_mercure.ksh
- Timestamp:
- 10/16/12 13:04:38 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libIGCM/libIGCM_sys/libIGCM_sys_mercure.ksh
r717 r719 559 559 #D- Error values and explanations can depend on your system version. 560 560 function IGCM_sys_Rsync_out { 561 RET=$1562 if [ ! $ RET] ; then561 status=$1 562 if [ ! $status ] ; then 563 563 echo "rsync error !" 564 564 fi 565 565 566 566 if [ $MYLANG = "fr" ]; then 567 case $ RETin567 case $status in 568 568 0) return ;; 569 569 1) echo "Erreur de rsync ; RERR_SYNTAX : " … … 613 613 echo "Temps d'attente écoulé dans l'envoi/réception de données" 614 614 return;; 615 *) echo "Erreur de rsync : code de retour de rsync inconnu :" $ RET615 *) echo "Erreur de rsync : code de retour de rsync inconnu :" $status 616 616 return;; 617 617 esac 618 618 elif [ $MYLANG = "en" ] ; then 619 case $ RETin619 case $status in 620 620 0) return;; 621 621 1) echo "rsync error : Syntax or usage error " … … 654 654 30) echo "rsync error : Timeout in data send/receive " 655 655 return;; 656 *) echo "rsync error : return code of rsync unknown :" $ RET656 *) echo "rsync error : return code of rsync unknown :" $status 657 657 return;; 658 658 esac … … 1078 1078 1079 1079 if [ X${skip} = Xfalse ] ; then 1080 (( i = 0 ))1080 i=0 1081 1081 while [ $i -lt $NB_ESSAI ] ; do 1082 1082 # USUAL WAY … … 1214 1214 IGCM_debug_PushStack "IGCM_sys_Get" $@ 1215 1215 1216 typeset DEST RETdm_liste ifile target file_work1216 typeset DEST dm_liste ifile target file_work 1217 1217 typeset NB_ESSAI DELAI status i 1218 1218 … … 1280 1280 #fi 1281 1281 1282 # #RSYNC WITH NETWORK SSH CALL 1283 # echo ${RSYNC} ${RSYNC_opt} -e ssh ${STOREHOST}:"${dm_liste}" ${STOREHOST}:${RUN_DIR}/${DEST} > out_rsync 2>&1 1284 # ${RSYNC} ${RSYNC_opt} -e ssh ${STOREHOST}:"${dm_liste}" ${STOREHOST}:${RUN_DIR}/${DEST} >> out_rsync 2>&1 1285 1286 # #RSYNC WITH NFS USE 1287 # echo ${RSYNC} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} > out_rsync 2>&1 1288 # ${RSYNC} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} >> out_rsync 2>&1 1289 1290 # status=$? 1291 # IGCM_sys_Rsync_out $status 1292 1293 # ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync 1294 # (( status=status+$? )) 1295 1282 1296 #USUAL WAY 1283 1297 if [ X${1} = X'/l' ] ; then 1284 (( RET=0 ))1285 1298 for target in ${dm_liste[*]} ; do 1286 1299 local_file=$( basename ${target} ) 1287 (( i = 0 ))1288 1300 # test if the target file is present before the loop 1289 1301 IGCM_sys_TestFileArchive ${target} … … 1293 1305 IGCM_debug_Exit "IGCM_sys_Get" 1294 1306 else 1307 i=0 1295 1308 while [ $i -lt $NB_ESSAI ] ; do 1296 1309 \cp ${target} ${DEST}/${local_file} >> out_rsync 2>&1 … … 1305 1318 (( i = i + 1 )) 1306 1319 done 1307 (( RET = RET + status )) 1320 if [ ${status} -gt 0 ] ; then 1321 echo "IGCM_sys_Get : error" 1322 cat out_rsync 1323 \rm out_rsync 1324 IGCM_debug_Exit "IGCM_sys_Get" 1325 else 1326 \rm out_rsync 1327 fi 1308 1328 fi 1309 1329 done 1310 1330 else 1311 \cp ${dm_liste} ${DEST} >> out_rsync 2>&1 1312 status=$? 1313 fi 1314 1315 # #RSYNC WITH NETWORK SSH CALL 1316 # echo ${RSYNC} ${RSYNC_opt} -e ssh ${STOREHOST}:"${dm_liste}" ${STOREHOST}:${RUN_DIR}/${DEST} > out_rsync 2>&1 1317 # ${RSYNC} ${RSYNC_opt} -e ssh ${STOREHOST}:"${dm_liste}" ${STOREHOST}:${RUN_DIR}/${DEST} >> out_rsync 2>&1 1318 1319 # #RSYNC WITH NFS USE 1320 # echo ${RSYNC} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} > out_rsync 2>&1 1321 # ${RSYNC} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} >> out_rsync 2>&1 1322 1323 # status=$? 1324 # IGCM_sys_Rsync_out $status 1325 1326 # ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync 1327 # (( RET=RET+$? )) 1328 1329 if [ ${RET} -gt 0 ] ; then 1330 echo "IGCM_sys_Get : error" 1331 cat out_rsync 1332 # IGCM_debug_Exit "IGCM_sys_Get" 1333 else 1334 \rm out_rsync 1331 i=0 1332 while [ $i -lt $NB_ESSAI ] ; do 1333 \cp ${dm_liste} ${DEST} >> out_rsync 2>&1 1334 status=$? 1335 if [ ${status} -gt 0 ]; then 1336 IGCM_debug_Print 2 "IGCM_sys_Get : cp failed error code ${status} ${i}/${NB_ESSAI}" 1337 IGCM_debug_Print 2 "IGCM_sys_Get : sleep ${DELAI} seconds and try again." 1338 sleep $DELAI 1339 else 1340 break 1341 fi 1342 (( i = i + 1 )) 1343 done 1344 if [ ${status} -gt 0 ] ; then 1345 echo "IGCM_sys_Get : error" 1346 cat out_rsync 1347 \rm out_rsync 1348 IGCM_debug_Exit "IGCM_sys_Get" 1349 else 1350 \rm out_rsync 1351 fi 1335 1352 fi 1336 1353 else … … 1348 1365 IGCM_debug_PushStack "IGCM_sys_GetBuffer" $@ 1349 1366 1350 typeset DEST RET status buf_liste ifile target file_work 1367 typeset DEST buf_liste ifile target file_work 1368 typeset NB_ESSAI DELAI status i 1351 1369 1352 1370 if ( $DEBUG_sys ) ; then 1353 1371 echo "IGCM_sys_GetBuffer :" $@ 1354 1372 fi 1373 1374 # number of tentative 1375 NB_ESSAI=3 1376 # time delay between tentative 1377 DELAI=2 1378 1355 1379 if [ $DRYRUN -le 2 ]; then 1356 1380 if [ X${1} = X'/l' ] ; then … … 1364 1388 #USUAL WAY 1365 1389 if [ X${1} = X'/l' ] ; then 1366 (( RET=0 ))1367 1390 for target in ${buf_liste[*]} ; do 1368 1391 local_file=$( basename ${target} ) 1369 \cp ${target} ${DEST}/${local_file} >> out_rsync 2>&1 1370 (( RET = RET + $? )) 1392 i=0 1393 while [ $i -lt $NB_ESSAI ] ; do 1394 \cp ${target} ${DEST}/${local_file} >> out_rsync 2>&1 1395 status=$? 1396 if [ ${status} -gt 0 ]; then 1397 IGCM_debug_Print 2 "IGCM_sys_GetBuffer : cp failed error code ${status} ${i}/${NB_ESSAI}" 1398 IGCM_debug_Print 2 "IGCM_sys_GetBuffer : sleep ${DELAI} seconds and try again." 1399 sleep $DELAI 1400 else 1401 break 1402 fi 1403 (( i = i + 1 )) 1404 done 1405 if [ ${status} -gt 0 ] ; then 1406 echo "IGCM_sys_Get : error" 1407 cat out_rsync 1408 \rm out_rsync 1409 IGCM_debug_Exit "IGCM_sys_GetBuffer" 1410 else 1411 \rm out_rsync 1412 fi 1371 1413 done 1372 1414 else 1373 \cp ${buf_liste} ${DEST} >> out_rsync 2>&1 1374 status=$? 1375 fi 1376 1377 if [ ${RET} -gt 0 ] ; then 1378 echo "IGCM_sys_GetBuffer : error" 1379 cat out_rsync 1380 \rm out_rsync 1381 IGCM_debug_Exit "IGCM_sys_GetBuffer" 1382 else 1383 \rm out_rsync 1415 i=0 1416 while [ $i -lt $NB_ESSAI ] ; do 1417 \cp ${buf_liste} ${DEST} >> out_rsync 2>&1 1418 status=$? 1419 if [ ${status} -gt 0 ]; then 1420 IGCM_debug_Print 2 "IGCM_sys_GetBuffer : cp failed error code ${status} ${i}/${NB_ESSAI}" 1421 IGCM_debug_Print 2 "IGCM_sys_GetBuffer : sleep ${DELAI} seconds and try again." 1422 sleep $DELAI 1423 else 1424 break 1425 fi 1426 (( i = i + 1 )) 1427 done 1428 if [ ${status} -gt 0 ] ; then 1429 echo "IGCM_sys_Get : error" 1430 cat out_rsync 1431 \rm out_rsync 1432 IGCM_debug_Exit "IGCM_sys_GetBuffer" 1433 else 1434 \rm out_rsync 1435 fi 1384 1436 fi 1385 1437 else … … 1552 1604 i=0 1553 1605 while [ $i -lt $NB_ESSAI ] ; do 1554 1606 /home/cont003/p86ipsl/X86_64/bin/rebuild -f -o $@ > out_rsync 2>&1 1555 1607 status=$? 1556 1608 if [ ${status} -gt 0 ] ; then
Note: See TracChangeset
for help on using the changeset viewer.