Changeset 719 for trunk/libIGCM/libIGCM_sys/libIGCM_sys_curie.ksh
- Timestamp:
- 10/16/12 13:04:38 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libIGCM/libIGCM_sys/libIGCM_sys_curie.ksh
r716 r719 712 712 #D- Error values and explanations can depend on your system version. 713 713 function IGCM_sys_Rsync_out { 714 RET=$1715 if [ ! $ RET] ; then714 status=$1 715 if [ ! $status ] ; then 716 716 echo "rsync error !" 717 717 fi 718 718 719 719 if [ $MYLANG = "fr" ]; then 720 case $ RETin720 case $status in 721 721 0) return ;; 722 722 1) echo "Erreur de rsync ; RERR_SYNTAX : " … … 766 766 echo "Temps d'attente écoulé dans l'envoi/réception de données" 767 767 return;; 768 *) echo "Erreur de rsync : code de retour de rsync inconnu :" $ RET768 *) echo "Erreur de rsync : code de retour de rsync inconnu :" $status 769 769 return;; 770 770 esac 771 771 elif [ $MYLANG = "en" ] ; then 772 case $ RETin772 case $status in 773 773 0) return;; 774 774 1) echo "rsync error : Syntax or usage error " … … 807 807 30) echo "rsync error : Timeout in data send/receive " 808 808 return;; 809 *) echo "rsync error : return code of rsync unknown :" $ RET809 *) echo "rsync error : return code of rsync unknown :" $status 810 810 return;; 811 811 esac … … 1275 1275 1276 1276 if [ X${skip} = Xfalse ] ; then 1277 (( i = 0 ))1277 i=0 1278 1278 while [ $i -lt $NB_ESSAI ] ; do 1279 1279 # USUAL WAY … … 1410 1410 IGCM_debug_PushStack "IGCM_sys_Get" $@ 1411 1411 1412 typeset DEST RETdm_liste ifile target file_work1412 typeset DEST dm_liste ifile target file_work 1413 1413 typeset NB_ESSAI DELAI status i 1414 1414 … … 1476 1476 #fi 1477 1477 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 1478 1492 #USUAL WAY 1479 1493 if [ X${1} = X'/l' ] ; then 1480 (( RET=0 ))1481 1494 for target in ${dm_liste[*]} ; do 1482 1495 local_file=$( basename ${target} ) 1483 (( i = 0 ))1484 1496 # test if the target file is present before the loop 1485 1497 IGCM_sys_TestFileArchive ${target} … … 1489 1501 IGCM_debug_Exit "IGCM_sys_Get" 1490 1502 else 1503 i=0 1491 1504 while [ $i -lt $NB_ESSAI ] ; do 1492 1505 \cp ${target} ${DEST}/${local_file} >> out_rsync 2>&1 … … 1501 1514 (( i = i + 1 )) 1502 1515 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 1504 1524 fi 1505 1525 done 1506 1526 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 1532 1548 fi 1533 1549 else … … 1545 1561 IGCM_debug_PushStack "IGCM_sys_GetBuffer" $@ 1546 1562 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 1548 1565 1549 1566 if ( $DEBUG_sys ) ; then 1550 1567 echo "IGCM_sys_GetBuffer :" $@ 1551 1568 fi 1569 1570 # number of tentative 1571 NB_ESSAI=3 1572 # time delay between tentative 1573 DELAI=2 1574 1552 1575 if [ $DRYRUN -le 2 ]; then 1553 1576 if [ X${1} = X'/l' ] ; then … … 1561 1584 #USUAL WAY 1562 1585 if [ X${1} = X'/l' ] ; then 1563 (( RET=0 ))1564 1586 for target in ${buf_liste[*]} ; do 1565 1587 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 1568 1609 done 1569 1610 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 1581 1632 fi 1582 1633 else
Note: See TracChangeset
for help on using the changeset viewer.