Changeset 719 for trunk


Ignore:
Timestamp:
10/16/12 13:04:38 (12 years ago)
Author:
sdipsl
Message:
  • curie, titane, mercurex9, mercure : minor bugfixes coming from r716 and r717. Further systematic loop over cp command
  • obelix, vargas, ulam : cosmetics
Location:
trunk/libIGCM/libIGCM_sys
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/libIGCM/libIGCM_sys/libIGCM_sys_curie.ksh

    r716 r719  
    712712#D-  Error values and explanations can depend on your system version. 
    713713function IGCM_sys_Rsync_out { 
    714   RET=$1 
    715   if [ ! $RET ] ; then 
     714  status=$1 
     715  if [ ! $status ] ; then 
    716716    echo "rsync error !" 
    717717  fi 
    718718 
    719719  if [ $MYLANG = "fr" ]; then 
    720     case $RET in 
     720    case $status in 
    721721    0)  return ;; 
    722722    1)  echo "Erreur de rsync ; RERR_SYNTAX : " 
     
    766766      echo "Temps d'attente écoulé dans l'envoi/réception de données" 
    767767      return;; 
    768     *)  echo "Erreur de rsync : code de retour de rsync inconnu :" $RET 
     768    *)  echo "Erreur de rsync : code de retour de rsync inconnu :" $status 
    769769      return;; 
    770770    esac 
    771771  elif [ $MYLANG = "en" ] ; then 
    772     case $RET in 
     772    case $status in 
    773773    0)  return;; 
    774774    1)  echo "rsync error : Syntax or usage error " 
     
    807807    30) echo "rsync error : Timeout in data send/receive " 
    808808      return;; 
    809     *)  echo "rsync error : return code of rsync unknown :" $RET 
     809    *)  echo "rsync error : return code of rsync unknown :" $status 
    810810      return;; 
    811811    esac 
     
    12751275 
    12761276    if [ X${skip} = Xfalse ] ; then 
    1277       (( i = 0 )) 
     1277      i=0 
    12781278      while [ $i -lt $NB_ESSAI ] ; do 
    12791279        # USUAL WAY 
     
    14101410  IGCM_debug_PushStack "IGCM_sys_Get" $@ 
    14111411 
    1412   typeset DEST RET dm_liste ifile target file_work 
     1412  typeset DEST dm_liste ifile target file_work 
    14131413  typeset NB_ESSAI DELAI status i 
    14141414 
     
    14761476    #fi 
    14771477 
     1478    #   #RSYNC WITH NETWORK SSH CALL 
     1479    #   echo ${RSYNC} ${RSYNC_opt} -e ssh ${STOREHOST}:"${dm_liste}" ${STOREHOST}:${RUN_DIR}/${DEST} > out_rsync 2>&1 
     1480    #   ${RSYNC} ${RSYNC_opt} -e ssh ${STOREHOST}:"${dm_liste}" ${STOREHOST}:${RUN_DIR}/${DEST} >> out_rsync 2>&1 
     1481 
     1482    #   #RSYNC WITH NFS USE 
     1483    #   echo ${RSYNC} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} > out_rsync 2>&1 
     1484    #   ${RSYNC} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} >> out_rsync 2>&1 
     1485 
     1486    #   status=$? 
     1487    #   IGCM_sys_Rsync_out $status 
     1488 
     1489    #   ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync 
     1490    #   (( status=status+$? )) 
     1491 
    14781492    #USUAL WAY 
    14791493    if [ X${1} = X'/l' ] ; then 
    1480       (( RET=0 )) 
    14811494      for target in ${dm_liste[*]} ; do 
    14821495        local_file=$( basename ${target} ) 
    1483         (( i = 0 )) 
    14841496        # test if the target file is present before the loop 
    14851497        IGCM_sys_TestFileArchive ${target} 
     
    14891501          IGCM_debug_Exit "IGCM_sys_Get" 
    14901502        else 
     1503          i=0 
    14911504          while [ $i -lt $NB_ESSAI ] ; do 
    14921505            \cp ${target} ${DEST}/${local_file} >> out_rsync 2>&1 
     
    15011514            (( i = i + 1 )) 
    15021515          done 
    1503           (( RET = RET + status )) 
     1516          if [ ${status} -gt 0 ] ; then 
     1517            echo "IGCM_sys_Get : error" 
     1518            cat out_rsync 
     1519            \rm out_rsync 
     1520            IGCM_debug_Exit "IGCM_sys_Get" 
     1521          else 
     1522            \rm out_rsync 
     1523          fi 
    15041524        fi 
    15051525      done 
    15061526    else 
    1507       \cp ${dm_liste} ${DEST} >> out_rsync 2>&1 
    1508       status=$? 
    1509     fi 
    1510  
    1511 #       #RSYNC WITH NETWORK SSH CALL 
    1512 #       echo ${RSYNC} ${RSYNC_opt} -e ssh ${STOREHOST}:"${dm_liste}" ${STOREHOST}:${RUN_DIR}/${DEST} > out_rsync 2>&1 
    1513 #       ${RSYNC} ${RSYNC_opt} -e ssh ${STOREHOST}:"${dm_liste}" ${STOREHOST}:${RUN_DIR}/${DEST} >> out_rsync 2>&1 
    1514  
    1515 #       #RSYNC WITH NFS USE 
    1516 #       echo ${RSYNC} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} > out_rsync 2>&1 
    1517 #       ${RSYNC} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} >> out_rsync 2>&1 
    1518  
    1519 #       status=$? 
    1520 #       IGCM_sys_Rsync_out $status 
    1521  
    1522 #       ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync 
    1523 #       (( RET=RET+$? )) 
    1524  
    1525     if [ ${RET} -gt 0 ] ; then 
    1526       echo "IGCM_sys_Get : error" 
    1527       cat out_rsync 
    1528       \rm out_rsync 
    1529       IGCM_debug_Exit "IGCM_sys_Get" 
    1530     else 
    1531       \rm out_rsync 
     1527      i=0 
     1528      while [ $i -lt $NB_ESSAI ] ; do 
     1529        \cp ${dm_liste} ${DEST} >> out_rsync 2>&1 
     1530        status=$? 
     1531        if [ ${status} -gt 0 ]; then 
     1532          IGCM_debug_Print 2 "IGCM_sys_Get : cp failed error code ${status} ${i}/${NB_ESSAI}" 
     1533          IGCM_debug_Print 2 "IGCM_sys_Get : sleep ${DELAI} seconds and try again." 
     1534          sleep $DELAI 
     1535        else 
     1536          break 
     1537        fi 
     1538        (( i = i + 1 )) 
     1539      done 
     1540      if [ ${status} -gt 0 ] ; then 
     1541        echo "IGCM_sys_Get : error" 
     1542        cat out_rsync 
     1543        \rm out_rsync 
     1544        IGCM_debug_Exit "IGCM_sys_Get" 
     1545      else 
     1546        \rm out_rsync 
     1547      fi 
    15321548    fi 
    15331549  else 
     
    15451561  IGCM_debug_PushStack "IGCM_sys_GetBuffer" $@ 
    15461562 
    1547   typeset DEST RET status buf_liste ifile target file_work 
     1563  typeset DEST buf_liste ifile target file_work 
     1564  typeset NB_ESSAI DELAI status i 
    15481565 
    15491566  if ( $DEBUG_sys ) ; then 
    15501567    echo "IGCM_sys_GetBuffer :" $@ 
    15511568  fi 
     1569 
     1570  # number of tentative 
     1571  NB_ESSAI=3 
     1572  # time delay between tentative 
     1573  DELAI=2 
     1574 
    15521575  if [ $DRYRUN -le 2 ]; then 
    15531576    if [ X${1} = X'/l' ] ; then 
     
    15611584    #USUAL WAY 
    15621585    if [ X${1} = X'/l' ] ; then 
    1563       (( RET=0 )) 
    15641586      for target in ${buf_liste[*]} ; do 
    15651587        local_file=$( basename ${target} ) 
    1566         \cp ${target} ${DEST}/${local_file} >> out_rsync 2>&1 
    1567         (( RET = RET + $? )) 
     1588        i=0 
     1589        while [ $i -lt $NB_ESSAI ] ; do 
     1590          \cp ${target} ${DEST}/${local_file} >> out_rsync 2>&1 
     1591          status=$? 
     1592          if [ ${status} -gt 0 ]; then 
     1593            IGCM_debug_Print 2 "IGCM_sys_GetBuffer : cp failed error code ${status} ${i}/${NB_ESSAI}" 
     1594            IGCM_debug_Print 2 "IGCM_sys_GetBuffer : sleep ${DELAI} seconds and try again." 
     1595            sleep $DELAI 
     1596          else 
     1597            break 
     1598          fi 
     1599          (( i = i + 1 )) 
     1600        done 
     1601        if [ ${status} -gt 0 ] ; then 
     1602          echo "IGCM_sys_Get : error" 
     1603          cat out_rsync 
     1604          \rm out_rsync 
     1605          IGCM_debug_Exit "IGCM_sys_GetBuffer" 
     1606        else 
     1607          \rm out_rsync 
     1608        fi 
    15681609      done 
    15691610    else 
    1570       \cp ${buf_liste} ${DEST} >> out_rsync 2>&1 
    1571       status=$? 
    1572     fi 
    1573  
    1574     if [ ${RET} -gt 0 ] ; then 
    1575       echo "IGCM_sys_GetBuffer : error" 
    1576       cat out_rsync 
    1577       \rm out_rsync 
    1578       IGCM_debug_Exit "IGCM_sys_GetBuffer" 
    1579     else 
    1580       \rm out_rsync 
     1611      i=0 
     1612      while [ $i -lt $NB_ESSAI ] ; do 
     1613        \cp ${buf_liste} ${DEST} >> out_rsync 2>&1 
     1614        status=$? 
     1615        if [ ${status} -gt 0 ]; then 
     1616          IGCM_debug_Print 2 "IGCM_sys_GetBuffer : cp failed error code ${status} ${i}/${NB_ESSAI}" 
     1617          IGCM_debug_Print 2 "IGCM_sys_GetBuffer : sleep ${DELAI} seconds and try again." 
     1618          sleep $DELAI 
     1619        else 
     1620          break 
     1621        fi 
     1622        (( i = i + 1 )) 
     1623      done 
     1624      if [ ${status} -gt 0 ] ; then 
     1625        echo "IGCM_sys_Get : error" 
     1626        cat out_rsync 
     1627        \rm out_rsync 
     1628        IGCM_debug_Exit "IGCM_sys_GetBuffer" 
     1629      else 
     1630        \rm out_rsync 
     1631      fi 
    15811632    fi 
    15821633  else 
  • trunk/libIGCM/libIGCM_sys/libIGCM_sys_mercure.ksh

    r717 r719  
    559559#D-  Error values and explanations can depend on your system version. 
    560560function IGCM_sys_Rsync_out { 
    561   RET=$1 
    562   if [ ! $RET ] ; then 
     561  status=$1 
     562  if [ ! $status ] ; then 
    563563    echo "rsync error !" 
    564564  fi 
    565565 
    566566  if [ $MYLANG = "fr" ]; then 
    567     case $RET in 
     567    case $status in 
    568568    0)  return ;; 
    569569    1)  echo "Erreur de rsync ; RERR_SYNTAX : " 
     
    613613      echo "Temps d'attente écoulé dans l'envoi/réception de données" 
    614614      return;; 
    615     *)  echo "Erreur de rsync : code de retour de rsync inconnu :" $RET 
     615    *)  echo "Erreur de rsync : code de retour de rsync inconnu :" $status 
    616616      return;; 
    617617    esac 
    618618  elif [ $MYLANG = "en" ] ; then 
    619     case $RET in 
     619    case $status in 
    620620    0)  return;; 
    621621    1)  echo "rsync error : Syntax or usage error " 
     
    654654    30) echo "rsync error : Timeout in data send/receive " 
    655655      return;; 
    656     *)  echo "rsync error : return code of rsync unknown :" $RET 
     656    *)  echo "rsync error : return code of rsync unknown :" $status 
    657657      return;; 
    658658    esac 
     
    10781078 
    10791079    if [ X${skip} = Xfalse ] ; then 
    1080       (( i = 0 )) 
     1080      i=0 
    10811081      while [ $i -lt $NB_ESSAI ] ; do 
    10821082        # USUAL WAY 
     
    12141214  IGCM_debug_PushStack "IGCM_sys_Get" $@ 
    12151215 
    1216   typeset DEST RET dm_liste ifile target file_work 
     1216  typeset DEST dm_liste ifile target file_work 
    12171217  typeset NB_ESSAI DELAI status i 
    12181218 
     
    12801280    #fi 
    12811281 
     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 
    12821296    #USUAL WAY 
    12831297    if [ X${1} = X'/l' ] ; then 
    1284       (( RET=0 )) 
    12851298      for target in ${dm_liste[*]} ; do 
    12861299        local_file=$( basename ${target} ) 
    1287         (( i = 0 )) 
    12881300        # test if the target file is present before the loop 
    12891301        IGCM_sys_TestFileArchive ${target} 
     
    12931305          IGCM_debug_Exit "IGCM_sys_Get" 
    12941306        else 
     1307          i=0 
    12951308          while [ $i -lt $NB_ESSAI ] ; do 
    12961309            \cp ${target} ${DEST}/${local_file} >> out_rsync 2>&1 
     
    13051318            (( i = i + 1 )) 
    13061319          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 
    13081328        fi 
    13091329      done 
    13101330    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 
    13351352    fi 
    13361353  else 
     
    13481365  IGCM_debug_PushStack "IGCM_sys_GetBuffer" $@ 
    13491366 
    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 
    13511369 
    13521370  if ( $DEBUG_sys ) ; then 
    13531371    echo "IGCM_sys_GetBuffer :" $@ 
    13541372  fi 
     1373 
     1374  # number of tentative 
     1375  NB_ESSAI=3 
     1376  # time delay between tentative 
     1377  DELAI=2 
     1378 
    13551379  if [ $DRYRUN -le 2 ]; then 
    13561380    if [ X${1} = X'/l' ] ; then 
     
    13641388    #USUAL WAY 
    13651389    if [ X${1} = X'/l' ] ; then 
    1366       (( RET=0 )) 
    13671390      for target in ${buf_liste[*]} ; do 
    13681391        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 
    13711413      done 
    13721414    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 
    13841436    fi 
    13851437  else 
     
    15521604  i=0 
    15531605  while [ $i -lt $NB_ESSAI ] ; do 
    1554       /home/cont003/p86ipsl/X86_64/bin/rebuild -f -o $@ > out_rsync 2>&1 
     1606    /home/cont003/p86ipsl/X86_64/bin/rebuild -f -o $@ > out_rsync 2>&1 
    15551607    status=$? 
    15561608    if [ ${status} -gt 0 ] ; then 
  • trunk/libIGCM/libIGCM_sys/libIGCM_sys_mercurex9.ksh

    r717 r719  
    1414#========================================================= 
    1515# The documentation of this file can be automatically generated 
    16 # if you use the prefix #D- for comments to be extracted.  
     16# if you use the prefix #D- for comments to be extracted. 
    1717# Extract with command: cat lib* | grep "^#D-" | cut -c "4-" 
    1818#========================================================= 
     
    2222#D-#================================================== 
    2323#D- 
    24 #D- This ksh library if a layer under some usefull  
     24#D- This ksh library if a layer under some usefull 
    2525#D-environment variables and shell commands. 
    2626#D-All those definitions depend on host particularities. 
     
    676676#D-  Error values and explanations can depend on your system version. 
    677677function IGCM_sys_Rsync_out { 
    678   RET=$1 
    679   if [ ! $RET ] ; then 
     678  status=$1 
     679  if [ ! $status ] ; then 
    680680    echo "rsync error !" 
    681681  fi 
    682682 
    683683  if [ $MYLANG = "fr" ]; then 
    684     case $RET in 
     684    case $status in 
    685685    0)  return ;; 
    686686    1)  echo "Erreur de rsync ; RERR_SYNTAX : " 
     
    730730      echo "Temps d'attente écoulé dans l'envoi/réception de données" 
    731731      return;; 
    732     *)  echo "Erreur de rsync : code de retour de rsync inconnu :" $RET 
     732    *)  echo "Erreur de rsync : code de retour de rsync inconnu :" $status 
    733733      return;; 
    734734    esac 
    735735  elif [ $MYLANG = "en" ] ; then 
    736     case $RET in 
     736    case $status in 
    737737    0)  return;; 
    738738    1)  echo "rsync error : Syntax or usage error " 
     
    771771    30) echo "rsync error : Timeout in data send/receive " 
    772772      return;; 
    773     *)  echo "rsync error : return code of rsync unknown :" $RET 
     773    *)  echo "rsync error : return code of rsync unknown :" $status 
    774774      return;; 
    775775    esac 
     
    11611161 
    11621162    if [ X${skip} = Xfalse ] ; then 
    1163       (( i = 0 )) 
     1163      i=0 
    11641164      while [ $i -lt $NB_ESSAI ] ; do 
    11651165        # USUAL WAY 
     
    12961296  IGCM_debug_PushStack "IGCM_sys_Get" $@ 
    12971297 
    1298   typeset DEST RET dm_liste ifile target file_work 
     1298  typeset DEST dm_liste ifile target file_work 
    12991299  typeset NB_ESSAI DELAI status i 
    13001300 
     
    13621362    #fi 
    13631363 
     1364    #   #RSYNC WITH NETWORK SSH CALL 
     1365    #   echo ${RSYNC} ${RSYNC_opt} -e ssh ${STOREHOST}:"${dm_liste}" ${STOREHOST}:${RUN_DIR}/${DEST} > out_rsync 2>&1 
     1366    #   ${RSYNC} ${RSYNC_opt} -e ssh ${STOREHOST}:"${dm_liste}" ${STOREHOST}:${RUN_DIR}/${DEST} >> out_rsync 2>&1 
     1367 
     1368    #   #RSYNC WITH NFS USE 
     1369    #   echo ${RSYNC} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} > out_rsync 2>&1 
     1370    #   ${RSYNC} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} >> out_rsync 2>&1 
     1371 
     1372    #   status=$? 
     1373    #   IGCM_sys_Rsync_out $status 
     1374 
     1375    #   ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync 
     1376    #   (( status=status+$? )) 
     1377 
    13641378    #USUAL WAY 
    13651379    if [ X${1} = X'/l' ] ; then 
    1366       (( RET=0 )) 
    13671380      for target in ${dm_liste[*]} ; do 
    13681381        local_file=$( basename ${target} ) 
    1369         (( i = 0 )) 
    13701382        # test if the target file is present before the loop 
    13711383        IGCM_sys_TestFileArchive ${target} 
     
    13751387          IGCM_debug_Exit "IGCM_sys_Get" 
    13761388        else 
     1389          i=0 
    13771390          while [ $i -lt $NB_ESSAI ] ; do 
    13781391            \cp ${target} ${DEST}/${local_file} >> out_rsync 2>&1 
     
    13871400            (( i = i + 1 )) 
    13881401          done 
    1389           (( RET = RET + status )) 
     1402          if [ ${status} -gt 0 ] ; then 
     1403            echo "IGCM_sys_Get : error" 
     1404            cat out_rsync 
     1405            \rm out_rsync 
     1406            IGCM_debug_Exit "IGCM_sys_Get" 
     1407          else 
     1408            \rm out_rsync 
     1409          fi 
    13901410        fi 
    13911411      done 
    13921412    else 
    1393       \cp ${dm_liste} ${DEST} >> out_rsync 2>&1 
    1394       status=$? 
    1395     fi 
    1396  
    1397 #       #RSYNC WITH NETWORK SSH CALL 
    1398 #       echo ${RSYNC} ${RSYNC_opt} -e ssh ${STOREHOST}:"${dm_liste}" ${STOREHOST}:${RUN_DIR}/${DEST} > out_rsync 2>&1 
    1399 #       ${RSYNC} ${RSYNC_opt} -e ssh ${STOREHOST}:"${dm_liste}" ${STOREHOST}:${RUN_DIR}/${DEST} >> out_rsync 2>&1 
    1400  
    1401 #       #RSYNC WITH NFS USE 
    1402 #       echo ${RSYNC} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} > out_rsync 2>&1 
    1403 #       ${RSYNC} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} >> out_rsync 2>&1 
    1404  
    1405 #       status=$? 
    1406 #       IGCM_sys_Rsync_out $status 
    1407  
    1408 #       ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync 
    1409 #       (( RET=RET+$? )) 
    1410  
    1411     if [ ${RET} -gt 0 ] ; then 
    1412       echo "IGCM_sys_Get : error" 
    1413       cat out_rsync 
    1414       \rm out_rsync 
    1415       IGCM_debug_Exit "IGCM_sys_Get" 
    1416     else 
    1417       \rm out_rsync 
     1413      i=0 
     1414      while [ $i -lt $NB_ESSAI ] ; do 
     1415        \cp ${dm_liste} ${DEST} >> out_rsync 2>&1 
     1416        status=$? 
     1417        if [ ${status} -gt 0 ]; then 
     1418          IGCM_debug_Print 2 "IGCM_sys_Get : cp failed error code ${status} ${i}/${NB_ESSAI}" 
     1419          IGCM_debug_Print 2 "IGCM_sys_Get : sleep ${DELAI} seconds and try again." 
     1420          sleep $DELAI 
     1421        else 
     1422          break 
     1423        fi 
     1424        (( i = i + 1 )) 
     1425      done 
     1426      if [ ${status} -gt 0 ] ; then 
     1427        echo "IGCM_sys_Get : error" 
     1428        cat out_rsync 
     1429        \rm out_rsync 
     1430        IGCM_debug_Exit "IGCM_sys_Get" 
     1431      else 
     1432        \rm out_rsync 
     1433      fi 
    14181434    fi 
    14191435  else 
     
    14311447  IGCM_debug_PushStack "IGCM_sys_GetBuffer" $@ 
    14321448 
    1433   typeset DEST RET status buf_liste ifile target file_work 
     1449  typeset DEST buf_liste ifile target file_work 
     1450  typeset NB_ESSAI DELAI status i 
    14341451 
    14351452  if ( $DEBUG_sys ) ; then 
    14361453    echo "IGCM_sys_GetBuffer :" $@ 
    14371454  fi 
     1455 
     1456  # number of tentative 
     1457  NB_ESSAI=3 
     1458  # time delay between tentative 
     1459  DELAI=2 
     1460 
    14381461  if [ $DRYRUN -le 2 ]; then 
    14391462    if [ X${1} = X'/l' ] ; then 
     
    14471470    #USUAL WAY 
    14481471    if [ X${1} = X'/l' ] ; then 
    1449       (( RET=0 )) 
    14501472      for target in ${buf_liste[*]} ; do 
    14511473        local_file=$( basename ${target} ) 
    1452         \cp ${target} ${DEST}/${local_file} >> out_rsync 2>&1 
    1453         (( RET = RET + $? )) 
     1474        i=0 
     1475        while [ $i -lt $NB_ESSAI ] ; do 
     1476          \cp ${target} ${DEST}/${local_file} >> out_rsync 2>&1 
     1477          status=$? 
     1478          if [ ${status} -gt 0 ]; then 
     1479            IGCM_debug_Print 2 "IGCM_sys_GetBuffer : cp failed error code ${status} ${i}/${NB_ESSAI}" 
     1480            IGCM_debug_Print 2 "IGCM_sys_GetBuffer : sleep ${DELAI} seconds and try again." 
     1481            sleep $DELAI 
     1482          else 
     1483            break 
     1484          fi 
     1485          (( i = i + 1 )) 
     1486        done 
     1487        if [ ${status} -gt 0 ] ; then 
     1488          echo "IGCM_sys_Get : error" 
     1489          cat out_rsync 
     1490          \rm out_rsync 
     1491          IGCM_debug_Exit "IGCM_sys_GetBuffer" 
     1492        else 
     1493          \rm out_rsync 
     1494        fi 
    14541495      done 
    14551496    else 
    1456       \cp ${buf_liste} ${DEST} >> out_rsync 2>&1 
    1457       status=$? 
    1458     fi 
    1459  
    1460     if [ ${RET} -gt 0 ] ; then 
    1461       echo "IGCM_sys_GetBuffer : error" 
    1462       cat out_rsync 
    1463       \rm out_rsync 
    1464       IGCM_debug_Exit "IGCM_sys_GetBuffer" 
    1465     else 
    1466       \rm out_rsync 
     1497      i=0 
     1498      while [ $i -lt $NB_ESSAI ] ; do 
     1499        \cp ${buf_liste} ${DEST} >> out_rsync 2>&1 
     1500        status=$? 
     1501        if [ ${status} -gt 0 ]; then 
     1502          IGCM_debug_Print 2 "IGCM_sys_GetBuffer : cp failed error code ${status} ${i}/${NB_ESSAI}" 
     1503          IGCM_debug_Print 2 "IGCM_sys_GetBuffer : sleep ${DELAI} seconds and try again." 
     1504          sleep $DELAI 
     1505        else 
     1506          break 
     1507        fi 
     1508        (( i = i + 1 )) 
     1509      done 
     1510      if [ ${status} -gt 0 ] ; then 
     1511        echo "IGCM_sys_Get : error" 
     1512        cat out_rsync 
     1513        \rm out_rsync 
     1514        IGCM_debug_Exit "IGCM_sys_GetBuffer" 
     1515      else 
     1516        \rm out_rsync 
     1517      fi 
    14671518    fi 
    14681519  else 
  • trunk/libIGCM/libIGCM_sys/libIGCM_sys_obelix.ksh

    r717 r719  
    883883    typeset status 
    884884 
    885         #USUAL WAY 
     885    #USUAL WAY 
    886886    \cp -R $1 $2 > out_rsync 2>&1 
    887887    status=$? 
     
    919919    typeset status 
    920920 
    921         #USUAL WAY 
     921    #USUAL WAY 
    922922    cp -RL $1 $2 > out_rsync 2>&1 
    923923    status=$? 
     
    10541054 
    10551055    typeset status 
    1056         # 
     1056    # 
    10571057    if [ X${JobType} = XRUN ] ; then 
    10581058      if [ X${3} = X ] ; then 
     
    10941094    echo "IGCM_sys_PutBuffer_Out :" $@ 
    10951095  fi 
     1096 
     1097  typeset status 
     1098 
    10961099  if [ $DRYRUN = 0 ]; then 
    10971100    if [ ! -f ${1} ] ; then 
     
    11031106    IGCM_sys_Mkdir $( dirname $2 ) 
    11041107    # 
    1105     typeset status 
    11061108 
    11071109    if [ X${JobType} = XRUN ] ; then 
     
    11571159      echo "IGCM_sys_Get, ERROR : regular file ${dm_liste[0]} DOES NOT EXIST ." 
    11581160      IGCM_debug_Exit "IGCM_sys_Get" 
    1159             #return 
     1161      #return 
    11601162    fi 
    11611163 
     
    12831285  return 0 
    12841286} 
    1285  
    12861287 
    12871288#D-#================================================== 
  • trunk/libIGCM/libIGCM_sys/libIGCM_sys_titane.ksh

    r717 r719  
    4242# YOU MUST COMPILE YOUR EXE FILES FOR DRYRUN MODE ! 
    4343# ------------------------------------------------------------------------------------- 
    44 # | DRYRUN=  |  Date computations, | sys_Get    |  Exe    | sys_Put_Out; sys_Put_Rest | 
    45 # |          |  Cp/Exe param files |            |  Chmod  |                           | 
    46 # |          |      Qsub           |            |         |                           | 
     44# | DRYRUN=  |  Date computations, | sys_Get    |  Exe    | sys_Put_Out; sys_Put_Rest | 
     45# |          |  Cp/Exe param files |            |  Chmod  |                           | 
     46# |          |      Qsub           |            |         |                           | 
    4747# ------------------------------------------------------------------------------------- 
    48 # |    0     |       yes           |    yes     |  yes    |      yes                  | 
     48# |    0     |       yes           |    yes     |  yes    |      yes                  | 
    4949# ------------------------------------------------------------------------------------- 
    50 # |    1     |       yes           |    yes     |  yes    |      no                   | 
     50# |    1     |       yes           |    yes     |  yes    |      no                   | 
    5151# ------------------------------------------------------------------------------------- 
    52 # |    2     |       yes           |    yes     |  no     |      no                   | 
     52# |    2     |       yes           |    yes     |  no     |      no                   | 
    5353# ------------------------------------------------------------------------------------- 
    54 # |    3     |       yes           |    no      |  no     |      no                   | 
     54# |    3     |       yes           |    no      |  no     |      no                   | 
    5555# ------------------------------------------------------------------------------------- 
    5656 
     
    346346  fi 
    347347 
    348     cat  << END_MAIL > job_end.mail 
     348  cat  << END_MAIL > job_end.mail 
    349349Dear ${LOGIN}, 
    350350 
     
    738738#D-  Error values and explanations can depend on your system version. 
    739739function IGCM_sys_Rsync_out { 
    740   RET=$1 
    741   if [ ! $RET ] ; then 
     740  status=$1 
     741  if [ ! $status ] ; then 
    742742    echo "rsync error !" 
    743743  fi 
    744744 
    745745  if [ $MYLANG = "fr" ]; then 
    746     case $RET in 
     746    case $status in 
    747747    0)  return ;; 
    748748    1)  echo "Erreur de rsync ; RERR_SYNTAX : " 
     
    792792      echo "Temps d'attente écoulé dans l'envoi/réception de données" 
    793793      return;; 
    794     *)  echo "Erreur de rsync : code de retour de rsync inconnu :" $RET 
     794    *)  echo "Erreur de rsync : code de retour de rsync inconnu :" $status 
    795795      return;; 
    796796    esac 
    797797  elif [ $MYLANG = "en" ] ; then 
    798     case $RET in 
     798    case $status in 
    799799    0)  return;; 
    800800    1)  echo "rsync error : Syntax or usage error " 
     
    833833    30) echo "rsync error : Timeout in data send/receive " 
    834834      return;; 
    835     *)  echo "rsync error : return code of rsync unknown :" $RET 
     835    *)  echo "rsync error : return code of rsync unknown :" $status 
    836836      return;; 
    837837    esac 
     
    13021302 
    13031303    if [ X${skip} = Xfalse ] ; then 
    1304       (( i = 0 )) 
     1304      i=0 
    13051305      while [ $i -lt $NB_ESSAI ] ; do 
    13061306        # USUAL WAY 
     
    14371437  IGCM_debug_PushStack "IGCM_sys_Get" $@ 
    14381438 
    1439   typeset DEST RET dm_liste ifile target file_work 
     1439  typeset DEST dm_liste ifile target file_work 
    14401440  typeset NB_ESSAI DELAI status i 
    14411441 
     
    15031503    #fi 
    15041504 
     1505    #   #RSYNC WITH NETWORK SSH CALL 
     1506    #   echo ${RSYNC} ${RSYNC_opt} -e ssh ${STOREHOST}:"${dm_liste}" ${STOREHOST}:${RUN_DIR}/${DEST} > out_rsync 2>&1 
     1507    #   ${RSYNC} ${RSYNC_opt} -e ssh ${STOREHOST}:"${dm_liste}" ${STOREHOST}:${RUN_DIR}/${DEST} >> out_rsync 2>&1 
     1508 
     1509    #   #RSYNC WITH NFS USE 
     1510    #   echo ${RSYNC} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} > out_rsync 2>&1 
     1511    #   ${RSYNC} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} >> out_rsync 2>&1 
     1512 
     1513    #   status=$? 
     1514    #   IGCM_sys_Rsync_out $status 
     1515 
     1516    #   ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync 
     1517    #   (( status=status+$? )) 
     1518 
    15051519    #USUAL WAY 
    15061520    if [ X${1} = X'/l' ] ; then 
    1507       (( RET=0 )) 
    15081521      for target in ${dm_liste[*]} ; do 
    15091522        local_file=$( basename ${target} ) 
    1510         (( i = 0 )) 
    15111523        # test if the target file is present before the loop 
    15121524        IGCM_sys_TestFileArchive ${target} 
     
    15161528          IGCM_debug_Exit "IGCM_sys_Get" 
    15171529        else 
     1530          i=0 
    15181531          while [ $i -lt $NB_ESSAI ] ; do 
    15191532            \cp ${target} ${DEST}/${local_file} >> out_rsync 2>&1 
     
    15281541            (( i = i + 1 )) 
    15291542          done 
    1530           (( RET = RET + status )) 
     1543          if [ ${status} -gt 0 ] ; then 
     1544            echo "IGCM_sys_Get : error" 
     1545            cat out_rsync 
     1546            \rm out_rsync 
     1547            IGCM_debug_Exit "IGCM_sys_Get" 
     1548          else 
     1549            \rm out_rsync 
     1550          fi 
    15311551        fi 
    15321552      done 
    15331553    else 
    1534       \cp ${dm_liste} ${DEST} >> out_rsync 2>&1 
    1535       status=$? 
    1536     fi 
    1537  
    1538 #       #RSYNC WITH NETWORK SSH CALL 
    1539 #       echo ${RSYNC} ${RSYNC_opt} -e ssh ${STOREHOST}:"${dm_liste}" ${STOREHOST}:${RUN_DIR}/${DEST} > out_rsync 2>&1 
    1540 #       ${RSYNC} ${RSYNC_opt} -e ssh ${STOREHOST}:"${dm_liste}" ${STOREHOST}:${RUN_DIR}/${DEST} >> out_rsync 2>&1 
    1541  
    1542 #       #RSYNC WITH NFS USE 
    1543 #       echo ${RSYNC} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} > out_rsync 2>&1 
    1544 #       ${RSYNC} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} >> out_rsync 2>&1 
    1545  
    1546 #       status=$? 
    1547 #       IGCM_sys_Rsync_out $status 
    1548  
    1549 #       ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync 
    1550 #       (( RET=RET+$? )) 
    1551  
    1552     if [ ${RET} -gt 0 ] ; then 
    1553       echo "IGCM_sys_Get : error" 
    1554       cat out_rsync 
    1555       \rm out_rsync 
    1556       IGCM_debug_Exit "IGCM_sys_Get" 
    1557     else 
    1558       \rm out_rsync 
     1554      i=0 
     1555      while [ $i -lt $NB_ESSAI ] ; do 
     1556        \cp ${dm_liste} ${DEST} >> out_rsync 2>&1 
     1557        status=$? 
     1558        if [ ${status} -gt 0 ]; then 
     1559          IGCM_debug_Print 2 "IGCM_sys_Get : cp failed error code ${status} ${i}/${NB_ESSAI}" 
     1560          IGCM_debug_Print 2 "IGCM_sys_Get : sleep ${DELAI} seconds and try again." 
     1561          sleep $DELAI 
     1562        else 
     1563          break 
     1564        fi 
     1565        (( i = i + 1 )) 
     1566      done 
     1567      if [ ${status} -gt 0 ] ; then 
     1568        echo "IGCM_sys_Get : error" 
     1569        cat out_rsync 
     1570        \rm out_rsync 
     1571        IGCM_debug_Exit "IGCM_sys_Get" 
     1572      else 
     1573        \rm out_rsync 
     1574      fi 
    15591575    fi 
    15601576  else 
     
    15721588  IGCM_debug_PushStack "IGCM_sys_GetBuffer" $@ 
    15731589 
    1574   typeset DEST RET status buf_liste ifile target file_work 
     1590  typeset DEST buf_liste ifile target file_work 
     1591  typeset NB_ESSAI DELAI status i 
    15751592 
    15761593  if ( $DEBUG_sys ) ; then 
    15771594    echo "IGCM_sys_GetBuffer :" $@ 
    15781595  fi 
     1596 
     1597  # number of tentative 
     1598  NB_ESSAI=3 
     1599  # time delay between tentative 
     1600  DELAI=2 
     1601 
    15791602  if [ $DRYRUN -le 2 ]; then 
    15801603    if [ X${1} = X'/l' ] ; then 
     
    15881611    #USUAL WAY 
    15891612    if [ X${1} = X'/l' ] ; then 
    1590       (( RET=0 )) 
    15911613      for target in ${buf_liste[*]} ; do 
    15921614        local_file=$( basename ${target} ) 
    1593         \cp ${target} ${DEST}/${local_file} >> out_rsync 2>&1 
    1594         (( RET = RET + $? )) 
     1615        i=0 
     1616        while [ $i -lt $NB_ESSAI ] ; do 
     1617          \cp ${target} ${DEST}/${local_file} >> out_rsync 2>&1 
     1618          status=$? 
     1619          if [ ${status} -gt 0 ]; then 
     1620            IGCM_debug_Print 2 "IGCM_sys_GetBuffer : cp failed error code ${status} ${i}/${NB_ESSAI}" 
     1621            IGCM_debug_Print 2 "IGCM_sys_GetBuffer : sleep ${DELAI} seconds and try again." 
     1622            sleep $DELAI 
     1623          else 
     1624            break 
     1625          fi 
     1626          (( i = i + 1 )) 
     1627        done 
     1628        if [ ${status} -gt 0 ] ; then 
     1629          echo "IGCM_sys_Get : error" 
     1630          cat out_rsync 
     1631          \rm out_rsync 
     1632          IGCM_debug_Exit "IGCM_sys_GetBuffer" 
     1633        else 
     1634          \rm out_rsync 
     1635        fi 
    15951636      done 
    15961637    else 
    1597       \cp ${buf_liste} ${DEST} >> out_rsync 2>&1 
    1598       status=$? 
    1599     fi 
    1600  
    1601     if [ ${RET} -gt 0 ] ; then 
    1602       echo "IGCM_sys_GetBuffer : error" 
    1603       cat out_rsync 
    1604       \rm out_rsync 
    1605       IGCM_debug_Exit "IGCM_sys_GetBuffer" 
    1606     else 
    1607       \rm out_rsync 
     1638      i=0 
     1639      while [ $i -lt $NB_ESSAI ] ; do 
     1640        \cp ${buf_liste} ${DEST} >> out_rsync 2>&1 
     1641        status=$? 
     1642        if [ ${status} -gt 0 ]; then 
     1643          IGCM_debug_Print 2 "IGCM_sys_GetBuffer : cp failed error code ${status} ${i}/${NB_ESSAI}" 
     1644          IGCM_debug_Print 2 "IGCM_sys_GetBuffer : sleep ${DELAI} seconds and try again." 
     1645          sleep $DELAI 
     1646        else 
     1647          break 
     1648        fi 
     1649        (( i = i + 1 )) 
     1650      done 
     1651      if [ ${status} -gt 0 ] ; then 
     1652        echo "IGCM_sys_Get : error" 
     1653        cat out_rsync 
     1654        \rm out_rsync 
     1655        IGCM_debug_Exit "IGCM_sys_GetBuffer" 
     1656      else 
     1657        \rm out_rsync 
     1658      fi 
    16081659    fi 
    16091660  else 
  • trunk/libIGCM/libIGCM_sys/libIGCM_sys_ulam.ksh

    r714 r719  
    509509#D-  Error values and explanations can depend on your system version. 
    510510function IGCM_sys_Rsync_out { 
    511   RET=$1 
    512   if [ ! $RET ] ; then 
     511  status=$1 
     512  if [ ! $status ] ; then 
    513513    echo "rsync error !" 
    514514  fi 
    515515 
    516516  if [ $MYLANG = "fr" ]; then 
    517     case $RET in 
     517    case $status in 
    518518    0)  return ;; 
    519519    1)  echo "Erreur de rsync ; RERR_SYNTAX : " 
     
    563563      echo "Temps d'attente écoulé dans l'envoi/réception de données" 
    564564      return;; 
    565     *)  echo "Erreur de rsync : code de retour de rsync inconnu :" $RET 
     565    *)  echo "Erreur de rsync : code de retour de rsync inconnu :" $status 
    566566      return;; 
    567567    esac 
    568568  elif [ $MYLANG = "en" ] ; then 
    569     case $RET in 
     569    case $status in 
    570570    0)  return;; 
    571571    1)  echo "rsync error : Syntax or usage error " 
     
    604604    30) echo "rsync error : Timeout in data send/receive " 
    605605      return;; 
    606     *)  echo "rsync error : return code of rsync unknown :" $RET 
     606    *)  echo "rsync error : return code of rsync unknown :" $status 
    607607      return;; 
    608608    esac 
     
    624624  fi 
    625625 
    626   typeset RET 
     626  typeset status 
    627627 
    628628  echo cp $@ > out_rsync 2>&1 
    629629  \cp $@ >> out_rsync 2>&1 
    630   RET=$? 
    631  
    632   if [ ${RET} -gt 0 ] ; then 
     630  status=$? 
     631 
     632  if [ ${status} -gt 0 ] ; then 
    633633    echo "IGCM_sys_Cp : error." 
    634634    cat out_rsync 
     
    649649  fi 
    650650 
    651   typeset RET 
     651  typeset status 
    652652 
    653653  echo rm $@ > out_rsync 2>&1 
    654654  \rm $@ >> out_rsync 2>&1 
    655   RET=$? 
    656  
    657   if [ ${RET} -gt 0 ] ; then 
     655  status=$? 
     656 
     657  if [ ${status} -gt 0 ] ; then 
    658658    echo "IGCM_sys_Rm : error." 
    659659    cat out_rsync 
     
    691691  if [ $DRYRUN = 0 ]; then 
    692692 
    693     typeset RET 
     693    typeset status 
    694694 
    695695    echo mv $@ > out_rsync 2>&1 
    696696    \mv $@ >> out_rsync 2>&1 
    697     RET=$? 
    698  
    699     if [ ${RET} -gt 0 ] ; then 
     697    status=$? 
     698 
     699    if [ ${status} -gt 0 ] ; then 
    700700      echo "IGCM_sys_Mv : error in mv." 
    701701      cat out_rsync 
     
    726726    fi 
    727727 
    728     typeset RET 
     728    typeset status 
    729729 
    730730    # Only if we use rsync 
     
    733733    #USUAL WAY 
    734734    rcp -r $1 gaya:$2 > out_rsync 2>&1 
    735     RET=$? 
    736  
    737     if [ ${RET} -gt 0 ] ; then 
     735    status=$? 
     736 
     737    if [ ${status} -gt 0 ] ; then 
    738738      echo "IGCM_sys_Put_Dir : error." 
    739739      cat out_rsync 
     
    768768#       fi 
    769769 
    770     typeset RET 
     770    typeset status 
    771771 
    772772    #USUAL WAY 
    773773    rcp -rp gaya:$1 $2 > out_rsync 2>&1 
    774     RET=$? 
    775  
    776     if [ ${RET} -gt 0 ] ; then 
     774    status=$? 
     775 
     776    if [ ${status} -gt 0 ] ; then 
    777777      echo "IGCM_sys_Get_Dir : error." 
    778778      cat out_rsync 
     
    803803    fi 
    804804 
    805     typeset RET 
     805    typeset status 
    806806 
    807807    #USUAL WAY 
    808808    rcp -r ${MASTER}:$1 $2 > out_rsync 2>&1 
    809     RET=$? 
    810  
    811     if [ ${RET} -gt 0 ] ; then 
     809    status=$? 
     810 
     811    if [ ${status} -gt 0 ] ; then 
    812812      echo "IGCM_sys_Get_Master : error." 
    813813      cat out_rsync 
     
    837837    fi 
    838838 
    839     typeset RET 
     839    typeset status 
    840840        # 
    841841    if [ X${JobType} = XRUN ] ; then 
     
    848848    # USUAL WAY 
    849849    mfput $1 $2 > out_rsync 2>&1 
    850     RET=$? 
     850    status=$? 
    851851 
    852852#       #RSYNC WITH NETWORK RSH CALL 
     
    858858#       ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} >> out_rsync 2>&1 
    859859 
    860 #       RET=$? 
    861 #       IGCM_sys_Rsync_out $RET 
     860#       status=$? 
     861#       IGCM_sys_Rsync_out $status 
    862862 
    863863#       ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync 
    864 #       (( RET=RET+$? )) 
    865  
    866     if [ ${RET} -gt 0 ] ; then 
     864#       (( status=status+$? )) 
     865 
     866    if [ ${status} -gt 0 ] ; then 
    867867      echo "IGCM_sys_Put_Out : error." 
    868868      cat out_rsync 
     
    870870            # 
    871871      mfput $1 $2 > out_rsync 2>&1 
    872       RET=$? 
     872      status=$? 
    873873            # 
    874       if [ ${RET} -gt 0 ] ; then 
     874      if [ ${status} -gt 0 ] ; then 
    875875        echo "IGCM_sys_Put_Out : error." 
    876876        IGCM_debug_Print 1 "mfput failed twice. You have a problem" 
     
    894894  IGCM_debug_PushStack "IGCM_sys_Get" $@ 
    895895 
    896   typeset DEST RET dm_liste ifile target 
     896  typeset DEST status dm_liste ifile target 
    897897 
    898898  if ( $DEBUG_sys ) ; then 
     
    910910    # test if the (first) file is present in the old computation : 
    911911    IGCM_sys_TestFileArchive ${dm_liste[0]} 
    912     RET=$? 
    913     if [ ${RET} -gt 0 ] ; then 
     912    status=$? 
     913    if [ ${status} -gt 0 ] ; then 
    914914      echo "IGCM_sys_Get, ERROR : regular file ${dm_liste[0]} DOES NOT EXIST ." 
    915915      IGCM_debug_Exit "IGCM_sys_Get" 
     
    942942#   ${RSYNC} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} >> out_rsync 2>&1 
    943943 
    944 #   RET=$? 
    945 #   IGCM_sys_Rsync_out $RET 
     944#   status=$? 
     945#   IGCM_sys_Rsync_out $status 
    946946 
    947947#   ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync 
    948 #   (( RET=RET+$? )) 
     948#   (( status=status+$? )) 
    949949 
    950950  else 
     
    974974    fi 
    975975 
    976     typeset RET 
     976    typeset status 
    977977    # 
    978978    rsh gaya exec /bin/ksh <<EOF 
     
    984984          /bin/chmod -R u+w ${R_SAVE}/${1} 
    985985EOF 
    986     RET=$? 
    987  
    988     if [ ${RET} -gt 0 ] ; then 
     986    status=$? 
     987 
     988    if [ ${status} -gt 0 ] ; then 
    989989      echo "IGCM_sys_Put_Dods : error." 
    990990      IGCM_debug_Exit "IGCM_sys_Put_Dods" 
  • trunk/libIGCM/libIGCM_sys/libIGCM_sys_vargas.ksh

    r697 r719  
    644644#D-  Error values and explanations can depend on your system version. 
    645645function IGCM_sys_Rsync_out { 
    646   RET=$1 
    647   if [ ! $RET ] ; then 
     646  status=$1 
     647  if [ ! $status ] ; then 
    648648    echo "rsync error !" 
    649649  fi 
    650650 
    651651  if [ $MYLANG = "fr" ]; then 
    652     case $RET in 
     652    case $status in 
    653653    0)  return ;; 
    654654    1)  echo "Erreur de rsync ; RERR_SYNTAX : " 
     
    698698      echo "Temps d'attente écoulé dans l'envoi/réception de données" 
    699699      return;; 
    700     *)  echo "Erreur de rsync : code de retour de rsync inconnu :" $RET 
     700    *)  echo "Erreur de rsync : code de retour de rsync inconnu :" $status 
    701701      return;; 
    702702    esac 
    703703  elif [ $MYLANG = "en" ] ; then 
    704     case $RET in 
     704    case $status in 
    705705    0)  return;; 
    706706    1)  echo "rsync error : Syntax or usage error " 
     
    739739    30) echo "rsync error : Timeout in data send/receive " 
    740740      return;; 
    741     *)  echo "rsync error : return code of rsync unknown :" $RET 
     741    *)  echo "rsync error : return code of rsync unknown :" $status 
    742742      return;; 
    743743    esac 
     
    759759  fi 
    760760 
    761   typeset RET 
     761  typeset status 
    762762 
    763763  IGCM_sys_RshPost <<-EOF 
     
    765765EOF 
    766766  rsh ulam -n hostname > /dev/null 2>&1 
    767   RET=$? 
    768   if [ $RET -eq 0 ] ; then 
     767  status=$? 
     768  if [ $status -eq 0 ] ; then 
    769769    echo ${RSYNC} ${RSYNC_opt} -e "rsh " ${libIGCM} ulam:${HOME_POST}/MIRROR/${PATHlibIGCM} > out_rsync 2>&1 
    770770    ${RSYNC} ${RSYNC_opt} -e "rsh " ${libIGCM} ulam:${HOME_POST}/MIRROR/${PATHlibIGCM} >> out_rsync 2>&1 
    771     RET=$? 
    772  
    773     if [ ${RET} -gt 0 ] ; then 
     771    status=$? 
     772 
     773    if [ ${status} -gt 0 ] ; then 
    774774      echo "IGCM_sys_Mirror_libIGCM Warning : no libIGCM on ulam." 
    775775      cat out_rsync 
     
    793793  fi 
    794794 
    795   typeset RET 
     795  typeset status 
    796796 
    797797  echo cp $@ > out_rsync 2>&1 
    798798  \cp $@ >> out_rsync 2>&1 
    799   RET=$? 
    800  
    801   if [ ${RET} -gt 0 ] ; then 
     799  status=$? 
     800 
     801  if [ ${status} -gt 0 ] ; then 
    802802    echo "IGCM_sys_Cp : error." 
    803803    cat out_rsync 
     
    820820  fi 
    821821 
    822   typeset RET 
     822  typeset status 
    823823 
    824824  echo rm $@ > out_rsync 2>&1 
    825825  \rm $@ >> out_rsync 2>&1 
    826   RET=$? 
    827  
    828   if [ ${RET} -gt 0 ] ; then 
     826  status=$? 
     827 
     828  if [ ${status} -gt 0 ] ; then 
    829829    echo "IGCM_sys_Rm : error." 
    830830    cat out_rsync 
     
    864864  if [ $DRYRUN = 0 ]; then 
    865865 
    866     typeset RET 
     866    typeset status 
    867867 
    868868    echo mv $@ > out_rsync 2>&1 
    869869    \mv $@ >> out_rsync 2>&1 
    870     RET=$? 
    871  
    872     if [ ${RET} -gt 0 ] ; then 
     870    status=$? 
     871 
     872    if [ ${status} -gt 0 ] ; then 
    873873      echo "IGCM_sys_Mv : error in mv." 
    874874      cat out_rsync 
     
    901901    fi 
    902902 
    903     typeset RET 
     903    typeset status 
    904904 
    905905    # Only if we use rsync 
     
    908908    #USUAL WAY 
    909909    rcp -r $1 ${STOREHOST}:$2 > out_rsync 2>&1 
    910     RET=$? 
    911  
    912     if [ ${RET} -gt 0 ] ; then 
     910    status=$? 
     911 
     912    if [ ${status} -gt 0 ] ; then 
    913913      echo "IGCM_sys_Put_Dir : error." 
    914914      cat out_rsync 
     
    940940    fi 
    941941 
    942     typeset RET 
     942    typeset status 
    943943 
    944944        #USUAL WAY 
    945945    rcp -rp ${STOREHOST}:$1 $2 > out_rsync 2>&1 
    946     RET=$? 
    947  
    948     if [ ${RET} -gt 0 ] ; then 
     946    status=$? 
     947 
     948    if [ ${status} -gt 0 ] ; then 
    949949      echo "IGCM_sys_Get_Dir : error." 
    950950      cat out_rsync 
     
    980980    fi 
    981981 
    982     typeset RET 
     982    typeset status 
    983983        # 
    984984    if [ X${JobType} = XRUN ] ; then 
     
    991991    #USUAL WAY 
    992992    mfput $1 $2 > out_rsync 2>&1 
    993     RET=$? 
     993    status=$? 
    994994 
    995995#       #RSYNC WITH NETWORK RSH CALL 
     
    10011001#       ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} >> out_rsync 2>&1 
    10021002 
    1003 #       RET=$? 
    1004 #       IGCM_sys_Rsync_out $RET 
     1003#       status=$? 
     1004#       IGCM_sys_Rsync_out $status 
    10051005 
    10061006#       ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync 
    1007 #       (( RET=RET+$? )) 
    1008  
    1009     if [ ${RET} -gt 0 ] ; then 
     1007#       (( status=status+$? )) 
     1008 
     1009    if [ ${status} -gt 0 ] ; then 
    10101010      echo "IGCM_sys_Put_Rest : error." 
    10111011      cat out_rsync 
     
    10371037    fi 
    10381038 
    1039     typeset RET 
     1039    typeset status 
    10401040    # 
    10411041    if [ X${JobType} = XRUN ] ; then 
     
    10461046    # USUAL WAY 
    10471047    \cp $1 $2 > out_rsync 2>&1 
    1048     RET=$? 
    1049  
    1050     if [ ${RET} -gt 0 ] ; then 
     1048    status=$? 
     1049 
     1050    if [ ${status} -gt 0 ] ; then 
    10511051      echo "IGCM_sys_PutBuffer_Rest : error." 
    10521052      cat out_rsync 
     
    10781078    fi 
    10791079 
    1080     typeset RET 
     1080    typeset status 
    10811081        # 
    10821082    if [ X${JobType} = XRUN ] ; then 
     
    10911091    #USUAL WAY 
    10921092    mfput $1 $2 > out_rsync 2>&1 
    1093     RET=$? 
     1093    status=$? 
    10941094 
    10951095#       #RSYNC WITH NETWORK RSH CALL 
     
    11011101#       ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} >> out_rsync 2>&1 
    11021102 
    1103 #       RET=$? 
    1104 #       IGCM_sys_Rsync_out $RET 
     1103#       status=$? 
     1104#       IGCM_sys_Rsync_out $status 
    11051105 
    11061106#       ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync 
    1107 #       (( RET=RET+$? )) 
    1108  
    1109     if [ ${RET} -gt 0 ] ; then 
     1107#       (( status=status+$? )) 
     1108 
     1109    if [ ${status} -gt 0 ] ; then 
    11101110      echo "IGCM_sys_Put_Out : error." 
    11111111      cat out_rsync 
     
    11411141    IGCM_sys_Mkdir $( dirname $2 ) 
    11421142    # 
    1143     typeset RET 
     1143    typeset status 
    11441144 
    11451145    if [ X${JobType} = XRUN ] ; then 
     
    11511151    # USUAL WAY 
    11521152    \cp $1 $2 > out_rsync 2>&1 
    1153     RET=$? 
    1154  
    1155     if [ ${RET} -gt 0 ] ; then 
     1153    status=$? 
     1154 
     1155    if [ ${status} -gt 0 ] ; then 
    11561156      echo "IGCM_sys_PutBuffer_Out : error." 
    11571157      cat out_rsync 
     
    11751175  IGCM_debug_PushStack "IGCM_sys_Get" $@ 
    11761176 
    1177   typeset DEST RET dm_liste ifile target 
     1177  typeset DEST status dm_liste ifile target 
    11781178 
    11791179  if ( $DEBUG_sys ) ; then 
     
    11911191    # test if the (first) file is present in the old computation : 
    11921192    IGCM_sys_TestFileArchive ${dm_liste[0]} 
    1193     RET=$? 
    1194     if [ ${RET} -gt 0 ] ; then 
     1193    status=$? 
     1194    if [ ${status} -gt 0 ] ; then 
    11951195      echo "IGCM_sys_Get, ERROR : regular file ${dm_liste[0]} DOES NOT EXIST ." 
    11961196      IGCM_debug_Exit "IGCM_sys_Get" 
     
    12111211    #USUAL WAY 
    12121212    mfget ${dm_liste[*]} ${DEST} > out_rsync 2>&1 
    1213     RET=$? 
     1213    status=$? 
    12141214 
    12151215#       #RSYNC WITH NETWORK RSH CALL 
     
    12211221#       ${RSYNC} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} >> out_rsync 2>&1 
    12221222 
    1223 #       RET=$? 
    1224 #       IGCM_sys_Rsync_out $RET 
     1223#       status=$? 
     1224#       IGCM_sys_Rsync_out $status 
    12251225 
    12261226#       ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync 
    1227 #       (( RET=RET+$? )) 
    1228  
    1229     if [ ${RET} -gt 0 ] ; then 
     1227#       (( status=status+$? )) 
     1228 
     1229    if [ ${status} -gt 0 ] ; then 
    12301230      echo "IGCM_sys_Get : copy error." 
    12311231      cat out_rsync 
     
    12481248  IGCM_debug_PushStack "IGCM_sys_GetBuffer" $@ 
    12491249 
    1250   typeset DEST RET buf_liste ifile target file_work 
     1250  typeset DEST status buf_liste ifile target file_work 
    12511251 
    12521252  if ( $DEBUG_sys ) ; then 
     
    12641264    #USUAL WAY 
    12651265    if [ X${1} = X'/l' ] ; then 
    1266       (( RET=0 )) 
     1266      (( status=0 )) 
    12671267      for target in ${buf_liste[*]} ; do 
    12681268        local_file=$( basename ${target} ) 
    12691269        \cp ${target} ${DEST}/${local_file} >> out_rsync 2>&1 
    1270         (( RET = RET + $? )) 
     1270        (( status = status + $? )) 
    12711271      done 
    12721272    else 
    12731273      \cp ${buf_liste} ${DEST} >> out_rsync 2>&1 
    1274       RET=$? 
    1275     fi 
    1276  
    1277     if [ ${RET} -gt 0 ] ; then 
     1274      status=$? 
     1275    fi 
     1276 
     1277    if [ ${status} -gt 0 ] ; then 
    12781278      echo "IGCM_sys_GetBuffer : copy error." 
    12791279      cat out_rsync 
Note: See TracChangeset for help on using the changeset viewer.