Ignore:
Timestamp:
06/05/12 16:31:28 (12 years ago)
Author:
sdipsl
Message:
  • Prevent the fact that cp command is not reliable on ccrt/tgcc filesystems
  • Cosmetics
File:
1 edited

Legend:

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

    r669 r676  
    12111211    echo "IGCM_sys_Put_Out :" $@ 
    12121212  fi 
     1213 
     1214  typeset NB_ESSAI DELAI RET i 
     1215 
     1216  # number of tentative 
     1217  NB_ESSAI=3 
     1218  # time delay between tentative 
     1219  DELAI=2 
     1220 
    12131221  if [ $DRYRUN = 0 ]; then 
    12141222    if [ ! -f ${1} ] ; then 
     
    12201228    IGCM_sys_MkdirArchive $( dirname $2 ) 
    12211229    # 
    1222     typeset RET 
    12231230 
    12241231    #===================================================== 
     
    12421249    fi 
    12431250    # 
     1251 
     1252    (( i = 0 )) 
     1253    while [ $i -lt $NB_ESSAI ] ; do 
    12441254    # USUAL WAY 
    1245     \cp $1 $2 > out_rsync 2>&1 
    1246     RET=$? 
     1255      \cp $1 $2 > out_rsync 2>&1 
     1256      RET=$? 
     1257      if [ ${RET} -gt 0 ]; then 
     1258        IGCM_debug_Print 2 "IGCM_sys_Put_Out : cp failed ${i}/${NB_ESSAI}" 
     1259        IGCM_debug_Print 2 "IGCM_sys_Put_Out : sleep ${DELAI} seconds and try again." 
     1260        sleep $DELAI 
     1261      else 
     1262        break 
     1263      fi 
     1264      (( i = i + 1 )) 
     1265    done 
    12471266 
    12481267#       #RSYNC WITH NETWORK SSH CALL 
     
    13281347 
    13291348  typeset DEST RET dm_liste ifile target file_work 
     1349  typeset NB_ESSAI DELAI status i 
    13301350 
    13311351  if ( $DEBUG_sys ) ; then 
    13321352    echo "IGCM_sys_Get :" $@ 
    13331353  fi 
     1354 
     1355  # number of tentative 
     1356  NB_ESSAI=3 
     1357  # time delay between tentative 
     1358  DELAI=2 
     1359 
    13341360  if [ $DRYRUN -le 2 ]; then 
    13351361    if [ X${1} = X'/l' ] ; then 
     
    13571383    #fi 
    13581384 
    1359     # test if the (first) file is present in the old computation : 
    1360     IGCM_sys_TestFileArchive ${dm_liste[0]} 
    1361     RET=$? 
    1362     if [ ${RET} -gt 0 ] ; then 
    1363       echo "IGCM_sys_Get, ERROR : regular file ${dm_liste[0]} DOES NOT EXIST ." 
    1364       IGCM_debug_Exit "IGCM_sys_Get" 
    1365     fi 
    1366  
    1367     #dmget ${dm_liste[*]} > out_rsync 2>&1 
    13681385    ccc_hsm get ${dm_liste[*]} > out_rsync 2>&1 
    13691386    RET=$? 
     
    14001417      for target in ${dm_liste[*]} ; do 
    14011418        local_file=$( basename ${target} ) 
    1402         \cp ${target} ${DEST}/${local_file} >> out_rsync 2>&1 
    1403         (( RET = RET + $? )) 
     1419        (( i = 0 )) 
     1420        # test if the target file is present before the loop 
     1421        IGCM_sys_TestFileArchive ${target} 
     1422        RET=$? 
     1423        if [ ${RET} -gt 0 ] ; then 
     1424          echo "IGCM_sys_Get, ERROR : regular file ${dm_liste[0]} DOES NOT EXIST ." 
     1425          IGCM_debug_Exit "IGCM_sys_Get" 
     1426        else 
     1427          while [ $i -lt $NB_ESSAI ] ; do 
     1428            \cp ${target} ${DEST}/${local_file} >> out_rsync 2>&1 
     1429            status=$? 
     1430            if [ ${status} -gt 0 ]; then 
     1431              IGCM_debug_Print 2 "IGCM_sys_Get : cp failed ${i}/${NB_ESSAI}" 
     1432              IGCM_debug_Print 2 "IGCM_sys_Get : sleep ${DELAI} seconds and try again." 
     1433              sleep $DELAI 
     1434            else 
     1435              break 
     1436            fi 
     1437            (( i = i + 1 )) 
     1438          done 
     1439          (( RET = RET + status )) 
     1440        fi 
    14041441      done 
    14051442    else 
Note: See TracChangeset for help on using the changeset viewer.