Changeset 719 for trunk/libIGCM/libIGCM_sys
- Timestamp:
- 10/16/12 13:04:38 (12 years ago)
- Location:
- trunk/libIGCM/libIGCM_sys
- Files:
-
- 7 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 -
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 -
trunk/libIGCM/libIGCM_sys/libIGCM_sys_mercurex9.ksh
r717 r719 14 14 #========================================================= 15 15 # 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. 17 17 # Extract with command: cat lib* | grep "^#D-" | cut -c "4-" 18 18 #========================================================= … … 22 22 #D-#================================================== 23 23 #D- 24 #D- This ksh library if a layer under some usefull 24 #D- This ksh library if a layer under some usefull 25 25 #D-environment variables and shell commands. 26 26 #D-All those definitions depend on host particularities. … … 676 676 #D- Error values and explanations can depend on your system version. 677 677 function IGCM_sys_Rsync_out { 678 RET=$1679 if [ ! $ RET] ; then678 status=$1 679 if [ ! $status ] ; then 680 680 echo "rsync error !" 681 681 fi 682 682 683 683 if [ $MYLANG = "fr" ]; then 684 case $ RETin684 case $status in 685 685 0) return ;; 686 686 1) echo "Erreur de rsync ; RERR_SYNTAX : " … … 730 730 echo "Temps d'attente écoulé dans l'envoi/réception de données" 731 731 return;; 732 *) echo "Erreur de rsync : code de retour de rsync inconnu :" $ RET732 *) echo "Erreur de rsync : code de retour de rsync inconnu :" $status 733 733 return;; 734 734 esac 735 735 elif [ $MYLANG = "en" ] ; then 736 case $ RETin736 case $status in 737 737 0) return;; 738 738 1) echo "rsync error : Syntax or usage error " … … 771 771 30) echo "rsync error : Timeout in data send/receive " 772 772 return;; 773 *) echo "rsync error : return code of rsync unknown :" $ RET773 *) echo "rsync error : return code of rsync unknown :" $status 774 774 return;; 775 775 esac … … 1161 1161 1162 1162 if [ X${skip} = Xfalse ] ; then 1163 (( i = 0 ))1163 i=0 1164 1164 while [ $i -lt $NB_ESSAI ] ; do 1165 1165 # USUAL WAY … … 1296 1296 IGCM_debug_PushStack "IGCM_sys_Get" $@ 1297 1297 1298 typeset DEST RETdm_liste ifile target file_work1298 typeset DEST dm_liste ifile target file_work 1299 1299 typeset NB_ESSAI DELAI status i 1300 1300 … … 1362 1362 #fi 1363 1363 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 1364 1378 #USUAL WAY 1365 1379 if [ X${1} = X'/l' ] ; then 1366 (( RET=0 ))1367 1380 for target in ${dm_liste[*]} ; do 1368 1381 local_file=$( basename ${target} ) 1369 (( i = 0 ))1370 1382 # test if the target file is present before the loop 1371 1383 IGCM_sys_TestFileArchive ${target} … … 1375 1387 IGCM_debug_Exit "IGCM_sys_Get" 1376 1388 else 1389 i=0 1377 1390 while [ $i -lt $NB_ESSAI ] ; do 1378 1391 \cp ${target} ${DEST}/${local_file} >> out_rsync 2>&1 … … 1387 1400 (( i = i + 1 )) 1388 1401 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 1390 1410 fi 1391 1411 done 1392 1412 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 1418 1434 fi 1419 1435 else … … 1431 1447 IGCM_debug_PushStack "IGCM_sys_GetBuffer" $@ 1432 1448 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 1434 1451 1435 1452 if ( $DEBUG_sys ) ; then 1436 1453 echo "IGCM_sys_GetBuffer :" $@ 1437 1454 fi 1455 1456 # number of tentative 1457 NB_ESSAI=3 1458 # time delay between tentative 1459 DELAI=2 1460 1438 1461 if [ $DRYRUN -le 2 ]; then 1439 1462 if [ X${1} = X'/l' ] ; then … … 1447 1470 #USUAL WAY 1448 1471 if [ X${1} = X'/l' ] ; then 1449 (( RET=0 ))1450 1472 for target in ${buf_liste[*]} ; do 1451 1473 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 1454 1495 done 1455 1496 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 1467 1518 fi 1468 1519 else -
trunk/libIGCM/libIGCM_sys/libIGCM_sys_obelix.ksh
r717 r719 883 883 typeset status 884 884 885 885 #USUAL WAY 886 886 \cp -R $1 $2 > out_rsync 2>&1 887 887 status=$? … … 919 919 typeset status 920 920 921 921 #USUAL WAY 922 922 cp -RL $1 $2 > out_rsync 2>&1 923 923 status=$? … … 1054 1054 1055 1055 typeset status 1056 1056 # 1057 1057 if [ X${JobType} = XRUN ] ; then 1058 1058 if [ X${3} = X ] ; then … … 1094 1094 echo "IGCM_sys_PutBuffer_Out :" $@ 1095 1095 fi 1096 1097 typeset status 1098 1096 1099 if [ $DRYRUN = 0 ]; then 1097 1100 if [ ! -f ${1} ] ; then … … 1103 1106 IGCM_sys_Mkdir $( dirname $2 ) 1104 1107 # 1105 typeset status1106 1108 1107 1109 if [ X${JobType} = XRUN ] ; then … … 1157 1159 echo "IGCM_sys_Get, ERROR : regular file ${dm_liste[0]} DOES NOT EXIST ." 1158 1160 IGCM_debug_Exit "IGCM_sys_Get" 1159 1161 #return 1160 1162 fi 1161 1163 … … 1283 1285 return 0 1284 1286 } 1285 1286 1287 1287 1288 #D-#================================================== -
trunk/libIGCM/libIGCM_sys/libIGCM_sys_titane.ksh
r717 r719 42 42 # YOU MUST COMPILE YOUR EXE FILES FOR DRYRUN MODE ! 43 43 # ------------------------------------------------------------------------------------- 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 | | | | 47 47 # ------------------------------------------------------------------------------------- 48 # | 0 | yes | yes| yes | yes |48 # | 0 | yes | yes | yes | yes | 49 49 # ------------------------------------------------------------------------------------- 50 # | 1 | yes | yes| yes | no |50 # | 1 | yes | yes | yes | no | 51 51 # ------------------------------------------------------------------------------------- 52 # | 2 | yes | yes| no | no |52 # | 2 | yes | yes | no | no | 53 53 # ------------------------------------------------------------------------------------- 54 # | 3 | yes | no| no | no |54 # | 3 | yes | no | no | no | 55 55 # ------------------------------------------------------------------------------------- 56 56 … … 346 346 fi 347 347 348 348 cat << END_MAIL > job_end.mail 349 349 Dear ${LOGIN}, 350 350 … … 738 738 #D- Error values and explanations can depend on your system version. 739 739 function IGCM_sys_Rsync_out { 740 RET=$1741 if [ ! $ RET] ; then740 status=$1 741 if [ ! $status ] ; then 742 742 echo "rsync error !" 743 743 fi 744 744 745 745 if [ $MYLANG = "fr" ]; then 746 case $ RETin746 case $status in 747 747 0) return ;; 748 748 1) echo "Erreur de rsync ; RERR_SYNTAX : " … … 792 792 echo "Temps d'attente écoulé dans l'envoi/réception de données" 793 793 return;; 794 *) echo "Erreur de rsync : code de retour de rsync inconnu :" $ RET794 *) echo "Erreur de rsync : code de retour de rsync inconnu :" $status 795 795 return;; 796 796 esac 797 797 elif [ $MYLANG = "en" ] ; then 798 case $ RETin798 case $status in 799 799 0) return;; 800 800 1) echo "rsync error : Syntax or usage error " … … 833 833 30) echo "rsync error : Timeout in data send/receive " 834 834 return;; 835 *) echo "rsync error : return code of rsync unknown :" $ RET835 *) echo "rsync error : return code of rsync unknown :" $status 836 836 return;; 837 837 esac … … 1302 1302 1303 1303 if [ X${skip} = Xfalse ] ; then 1304 (( i = 0 ))1304 i=0 1305 1305 while [ $i -lt $NB_ESSAI ] ; do 1306 1306 # USUAL WAY … … 1437 1437 IGCM_debug_PushStack "IGCM_sys_Get" $@ 1438 1438 1439 typeset DEST RETdm_liste ifile target file_work1439 typeset DEST dm_liste ifile target file_work 1440 1440 typeset NB_ESSAI DELAI status i 1441 1441 … … 1503 1503 #fi 1504 1504 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 1505 1519 #USUAL WAY 1506 1520 if [ X${1} = X'/l' ] ; then 1507 (( RET=0 ))1508 1521 for target in ${dm_liste[*]} ; do 1509 1522 local_file=$( basename ${target} ) 1510 (( i = 0 ))1511 1523 # test if the target file is present before the loop 1512 1524 IGCM_sys_TestFileArchive ${target} … … 1516 1528 IGCM_debug_Exit "IGCM_sys_Get" 1517 1529 else 1530 i=0 1518 1531 while [ $i -lt $NB_ESSAI ] ; do 1519 1532 \cp ${target} ${DEST}/${local_file} >> out_rsync 2>&1 … … 1528 1541 (( i = i + 1 )) 1529 1542 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 1531 1551 fi 1532 1552 done 1533 1553 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 1559 1575 fi 1560 1576 else … … 1572 1588 IGCM_debug_PushStack "IGCM_sys_GetBuffer" $@ 1573 1589 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 1575 1592 1576 1593 if ( $DEBUG_sys ) ; then 1577 1594 echo "IGCM_sys_GetBuffer :" $@ 1578 1595 fi 1596 1597 # number of tentative 1598 NB_ESSAI=3 1599 # time delay between tentative 1600 DELAI=2 1601 1579 1602 if [ $DRYRUN -le 2 ]; then 1580 1603 if [ X${1} = X'/l' ] ; then … … 1588 1611 #USUAL WAY 1589 1612 if [ X${1} = X'/l' ] ; then 1590 (( RET=0 ))1591 1613 for target in ${buf_liste[*]} ; do 1592 1614 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 1595 1636 done 1596 1637 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 1608 1659 fi 1609 1660 else -
trunk/libIGCM/libIGCM_sys/libIGCM_sys_ulam.ksh
r714 r719 509 509 #D- Error values and explanations can depend on your system version. 510 510 function IGCM_sys_Rsync_out { 511 RET=$1512 if [ ! $ RET] ; then511 status=$1 512 if [ ! $status ] ; then 513 513 echo "rsync error !" 514 514 fi 515 515 516 516 if [ $MYLANG = "fr" ]; then 517 case $ RETin517 case $status in 518 518 0) return ;; 519 519 1) echo "Erreur de rsync ; RERR_SYNTAX : " … … 563 563 echo "Temps d'attente écoulé dans l'envoi/réception de données" 564 564 return;; 565 *) echo "Erreur de rsync : code de retour de rsync inconnu :" $ RET565 *) echo "Erreur de rsync : code de retour de rsync inconnu :" $status 566 566 return;; 567 567 esac 568 568 elif [ $MYLANG = "en" ] ; then 569 case $ RETin569 case $status in 570 570 0) return;; 571 571 1) echo "rsync error : Syntax or usage error " … … 604 604 30) echo "rsync error : Timeout in data send/receive " 605 605 return;; 606 *) echo "rsync error : return code of rsync unknown :" $ RET606 *) echo "rsync error : return code of rsync unknown :" $status 607 607 return;; 608 608 esac … … 624 624 fi 625 625 626 typeset RET626 typeset status 627 627 628 628 echo cp $@ > out_rsync 2>&1 629 629 \cp $@ >> out_rsync 2>&1 630 RET=$?631 632 if [ ${ RET} -gt 0 ] ; then630 status=$? 631 632 if [ ${status} -gt 0 ] ; then 633 633 echo "IGCM_sys_Cp : error." 634 634 cat out_rsync … … 649 649 fi 650 650 651 typeset RET651 typeset status 652 652 653 653 echo rm $@ > out_rsync 2>&1 654 654 \rm $@ >> out_rsync 2>&1 655 RET=$?656 657 if [ ${ RET} -gt 0 ] ; then655 status=$? 656 657 if [ ${status} -gt 0 ] ; then 658 658 echo "IGCM_sys_Rm : error." 659 659 cat out_rsync … … 691 691 if [ $DRYRUN = 0 ]; then 692 692 693 typeset RET693 typeset status 694 694 695 695 echo mv $@ > out_rsync 2>&1 696 696 \mv $@ >> out_rsync 2>&1 697 RET=$?698 699 if [ ${ RET} -gt 0 ] ; then697 status=$? 698 699 if [ ${status} -gt 0 ] ; then 700 700 echo "IGCM_sys_Mv : error in mv." 701 701 cat out_rsync … … 726 726 fi 727 727 728 typeset RET728 typeset status 729 729 730 730 # Only if we use rsync … … 733 733 #USUAL WAY 734 734 rcp -r $1 gaya:$2 > out_rsync 2>&1 735 RET=$?736 737 if [ ${ RET} -gt 0 ] ; then735 status=$? 736 737 if [ ${status} -gt 0 ] ; then 738 738 echo "IGCM_sys_Put_Dir : error." 739 739 cat out_rsync … … 768 768 # fi 769 769 770 typeset RET770 typeset status 771 771 772 772 #USUAL WAY 773 773 rcp -rp gaya:$1 $2 > out_rsync 2>&1 774 RET=$?775 776 if [ ${ RET} -gt 0 ] ; then774 status=$? 775 776 if [ ${status} -gt 0 ] ; then 777 777 echo "IGCM_sys_Get_Dir : error." 778 778 cat out_rsync … … 803 803 fi 804 804 805 typeset RET805 typeset status 806 806 807 807 #USUAL WAY 808 808 rcp -r ${MASTER}:$1 $2 > out_rsync 2>&1 809 RET=$?810 811 if [ ${ RET} -gt 0 ] ; then809 status=$? 810 811 if [ ${status} -gt 0 ] ; then 812 812 echo "IGCM_sys_Get_Master : error." 813 813 cat out_rsync … … 837 837 fi 838 838 839 typeset RET839 typeset status 840 840 # 841 841 if [ X${JobType} = XRUN ] ; then … … 848 848 # USUAL WAY 849 849 mfput $1 $2 > out_rsync 2>&1 850 RET=$?850 status=$? 851 851 852 852 # #RSYNC WITH NETWORK RSH CALL … … 858 858 # ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} >> out_rsync 2>&1 859 859 860 # RET=$?861 # IGCM_sys_Rsync_out $ RET860 # status=$? 861 # IGCM_sys_Rsync_out $status 862 862 863 863 # ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync 864 # (( RET=RET+$? ))865 866 if [ ${ RET} -gt 0 ] ; then864 # (( status=status+$? )) 865 866 if [ ${status} -gt 0 ] ; then 867 867 echo "IGCM_sys_Put_Out : error." 868 868 cat out_rsync … … 870 870 # 871 871 mfput $1 $2 > out_rsync 2>&1 872 RET=$?872 status=$? 873 873 # 874 if [ ${ RET} -gt 0 ] ; then874 if [ ${status} -gt 0 ] ; then 875 875 echo "IGCM_sys_Put_Out : error." 876 876 IGCM_debug_Print 1 "mfput failed twice. You have a problem" … … 894 894 IGCM_debug_PushStack "IGCM_sys_Get" $@ 895 895 896 typeset DEST RETdm_liste ifile target896 typeset DEST status dm_liste ifile target 897 897 898 898 if ( $DEBUG_sys ) ; then … … 910 910 # test if the (first) file is present in the old computation : 911 911 IGCM_sys_TestFileArchive ${dm_liste[0]} 912 RET=$?913 if [ ${ RET} -gt 0 ] ; then912 status=$? 913 if [ ${status} -gt 0 ] ; then 914 914 echo "IGCM_sys_Get, ERROR : regular file ${dm_liste[0]} DOES NOT EXIST ." 915 915 IGCM_debug_Exit "IGCM_sys_Get" … … 942 942 # ${RSYNC} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} >> out_rsync 2>&1 943 943 944 # RET=$?945 # IGCM_sys_Rsync_out $ RET944 # status=$? 945 # IGCM_sys_Rsync_out $status 946 946 947 947 # ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync 948 # (( RET=RET+$? ))948 # (( status=status+$? )) 949 949 950 950 else … … 974 974 fi 975 975 976 typeset RET976 typeset status 977 977 # 978 978 rsh gaya exec /bin/ksh <<EOF … … 984 984 /bin/chmod -R u+w ${R_SAVE}/${1} 985 985 EOF 986 RET=$?987 988 if [ ${ RET} -gt 0 ] ; then986 status=$? 987 988 if [ ${status} -gt 0 ] ; then 989 989 echo "IGCM_sys_Put_Dods : error." 990 990 IGCM_debug_Exit "IGCM_sys_Put_Dods" -
trunk/libIGCM/libIGCM_sys/libIGCM_sys_vargas.ksh
r697 r719 644 644 #D- Error values and explanations can depend on your system version. 645 645 function IGCM_sys_Rsync_out { 646 RET=$1647 if [ ! $ RET] ; then646 status=$1 647 if [ ! $status ] ; then 648 648 echo "rsync error !" 649 649 fi 650 650 651 651 if [ $MYLANG = "fr" ]; then 652 case $ RETin652 case $status in 653 653 0) return ;; 654 654 1) echo "Erreur de rsync ; RERR_SYNTAX : " … … 698 698 echo "Temps d'attente écoulé dans l'envoi/réception de données" 699 699 return;; 700 *) echo "Erreur de rsync : code de retour de rsync inconnu :" $ RET700 *) echo "Erreur de rsync : code de retour de rsync inconnu :" $status 701 701 return;; 702 702 esac 703 703 elif [ $MYLANG = "en" ] ; then 704 case $ RETin704 case $status in 705 705 0) return;; 706 706 1) echo "rsync error : Syntax or usage error " … … 739 739 30) echo "rsync error : Timeout in data send/receive " 740 740 return;; 741 *) echo "rsync error : return code of rsync unknown :" $ RET741 *) echo "rsync error : return code of rsync unknown :" $status 742 742 return;; 743 743 esac … … 759 759 fi 760 760 761 typeset RET761 typeset status 762 762 763 763 IGCM_sys_RshPost <<-EOF … … 765 765 EOF 766 766 rsh ulam -n hostname > /dev/null 2>&1 767 RET=$?768 if [ $ RET-eq 0 ] ; then767 status=$? 768 if [ $status -eq 0 ] ; then 769 769 echo ${RSYNC} ${RSYNC_opt} -e "rsh " ${libIGCM} ulam:${HOME_POST}/MIRROR/${PATHlibIGCM} > out_rsync 2>&1 770 770 ${RSYNC} ${RSYNC_opt} -e "rsh " ${libIGCM} ulam:${HOME_POST}/MIRROR/${PATHlibIGCM} >> out_rsync 2>&1 771 RET=$?772 773 if [ ${ RET} -gt 0 ] ; then771 status=$? 772 773 if [ ${status} -gt 0 ] ; then 774 774 echo "IGCM_sys_Mirror_libIGCM Warning : no libIGCM on ulam." 775 775 cat out_rsync … … 793 793 fi 794 794 795 typeset RET795 typeset status 796 796 797 797 echo cp $@ > out_rsync 2>&1 798 798 \cp $@ >> out_rsync 2>&1 799 RET=$?800 801 if [ ${ RET} -gt 0 ] ; then799 status=$? 800 801 if [ ${status} -gt 0 ] ; then 802 802 echo "IGCM_sys_Cp : error." 803 803 cat out_rsync … … 820 820 fi 821 821 822 typeset RET822 typeset status 823 823 824 824 echo rm $@ > out_rsync 2>&1 825 825 \rm $@ >> out_rsync 2>&1 826 RET=$?827 828 if [ ${ RET} -gt 0 ] ; then826 status=$? 827 828 if [ ${status} -gt 0 ] ; then 829 829 echo "IGCM_sys_Rm : error." 830 830 cat out_rsync … … 864 864 if [ $DRYRUN = 0 ]; then 865 865 866 typeset RET866 typeset status 867 867 868 868 echo mv $@ > out_rsync 2>&1 869 869 \mv $@ >> out_rsync 2>&1 870 RET=$?871 872 if [ ${ RET} -gt 0 ] ; then870 status=$? 871 872 if [ ${status} -gt 0 ] ; then 873 873 echo "IGCM_sys_Mv : error in mv." 874 874 cat out_rsync … … 901 901 fi 902 902 903 typeset RET903 typeset status 904 904 905 905 # Only if we use rsync … … 908 908 #USUAL WAY 909 909 rcp -r $1 ${STOREHOST}:$2 > out_rsync 2>&1 910 RET=$?911 912 if [ ${ RET} -gt 0 ] ; then910 status=$? 911 912 if [ ${status} -gt 0 ] ; then 913 913 echo "IGCM_sys_Put_Dir : error." 914 914 cat out_rsync … … 940 940 fi 941 941 942 typeset RET942 typeset status 943 943 944 944 #USUAL WAY 945 945 rcp -rp ${STOREHOST}:$1 $2 > out_rsync 2>&1 946 RET=$?947 948 if [ ${ RET} -gt 0 ] ; then946 status=$? 947 948 if [ ${status} -gt 0 ] ; then 949 949 echo "IGCM_sys_Get_Dir : error." 950 950 cat out_rsync … … 980 980 fi 981 981 982 typeset RET982 typeset status 983 983 # 984 984 if [ X${JobType} = XRUN ] ; then … … 991 991 #USUAL WAY 992 992 mfput $1 $2 > out_rsync 2>&1 993 RET=$?993 status=$? 994 994 995 995 # #RSYNC WITH NETWORK RSH CALL … … 1001 1001 # ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} >> out_rsync 2>&1 1002 1002 1003 # RET=$?1004 # IGCM_sys_Rsync_out $ RET1003 # status=$? 1004 # IGCM_sys_Rsync_out $status 1005 1005 1006 1006 # ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync 1007 # (( RET=RET+$? ))1008 1009 if [ ${ RET} -gt 0 ] ; then1007 # (( status=status+$? )) 1008 1009 if [ ${status} -gt 0 ] ; then 1010 1010 echo "IGCM_sys_Put_Rest : error." 1011 1011 cat out_rsync … … 1037 1037 fi 1038 1038 1039 typeset RET1039 typeset status 1040 1040 # 1041 1041 if [ X${JobType} = XRUN ] ; then … … 1046 1046 # USUAL WAY 1047 1047 \cp $1 $2 > out_rsync 2>&1 1048 RET=$?1049 1050 if [ ${ RET} -gt 0 ] ; then1048 status=$? 1049 1050 if [ ${status} -gt 0 ] ; then 1051 1051 echo "IGCM_sys_PutBuffer_Rest : error." 1052 1052 cat out_rsync … … 1078 1078 fi 1079 1079 1080 typeset RET1080 typeset status 1081 1081 # 1082 1082 if [ X${JobType} = XRUN ] ; then … … 1091 1091 #USUAL WAY 1092 1092 mfput $1 $2 > out_rsync 2>&1 1093 RET=$?1093 status=$? 1094 1094 1095 1095 # #RSYNC WITH NETWORK RSH CALL … … 1101 1101 # ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} >> out_rsync 2>&1 1102 1102 1103 # RET=$?1104 # IGCM_sys_Rsync_out $ RET1103 # status=$? 1104 # IGCM_sys_Rsync_out $status 1105 1105 1106 1106 # ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync 1107 # (( RET=RET+$? ))1108 1109 if [ ${ RET} -gt 0 ] ; then1107 # (( status=status+$? )) 1108 1109 if [ ${status} -gt 0 ] ; then 1110 1110 echo "IGCM_sys_Put_Out : error." 1111 1111 cat out_rsync … … 1141 1141 IGCM_sys_Mkdir $( dirname $2 ) 1142 1142 # 1143 typeset RET1143 typeset status 1144 1144 1145 1145 if [ X${JobType} = XRUN ] ; then … … 1151 1151 # USUAL WAY 1152 1152 \cp $1 $2 > out_rsync 2>&1 1153 RET=$?1154 1155 if [ ${ RET} -gt 0 ] ; then1153 status=$? 1154 1155 if [ ${status} -gt 0 ] ; then 1156 1156 echo "IGCM_sys_PutBuffer_Out : error." 1157 1157 cat out_rsync … … 1175 1175 IGCM_debug_PushStack "IGCM_sys_Get" $@ 1176 1176 1177 typeset DEST RETdm_liste ifile target1177 typeset DEST status dm_liste ifile target 1178 1178 1179 1179 if ( $DEBUG_sys ) ; then … … 1191 1191 # test if the (first) file is present in the old computation : 1192 1192 IGCM_sys_TestFileArchive ${dm_liste[0]} 1193 RET=$?1194 if [ ${ RET} -gt 0 ] ; then1193 status=$? 1194 if [ ${status} -gt 0 ] ; then 1195 1195 echo "IGCM_sys_Get, ERROR : regular file ${dm_liste[0]} DOES NOT EXIST ." 1196 1196 IGCM_debug_Exit "IGCM_sys_Get" … … 1211 1211 #USUAL WAY 1212 1212 mfget ${dm_liste[*]} ${DEST} > out_rsync 2>&1 1213 RET=$?1213 status=$? 1214 1214 1215 1215 # #RSYNC WITH NETWORK RSH CALL … … 1221 1221 # ${RSYNC} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} >> out_rsync 2>&1 1222 1222 1223 # RET=$?1224 # IGCM_sys_Rsync_out $ RET1223 # status=$? 1224 # IGCM_sys_Rsync_out $status 1225 1225 1226 1226 # ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync 1227 # (( RET=RET+$? ))1228 1229 if [ ${ RET} -gt 0 ] ; then1227 # (( status=status+$? )) 1228 1229 if [ ${status} -gt 0 ] ; then 1230 1230 echo "IGCM_sys_Get : copy error." 1231 1231 cat out_rsync … … 1248 1248 IGCM_debug_PushStack "IGCM_sys_GetBuffer" $@ 1249 1249 1250 typeset DEST RETbuf_liste ifile target file_work1250 typeset DEST status buf_liste ifile target file_work 1251 1251 1252 1252 if ( $DEBUG_sys ) ; then … … 1264 1264 #USUAL WAY 1265 1265 if [ X${1} = X'/l' ] ; then 1266 (( RET=0 ))1266 (( status=0 )) 1267 1267 for target in ${buf_liste[*]} ; do 1268 1268 local_file=$( basename ${target} ) 1269 1269 \cp ${target} ${DEST}/${local_file} >> out_rsync 2>&1 1270 (( RET = RET+ $? ))1270 (( status = status + $? )) 1271 1271 done 1272 1272 else 1273 1273 \cp ${buf_liste} ${DEST} >> out_rsync 2>&1 1274 RET=$?1275 fi 1276 1277 if [ ${ RET} -gt 0 ] ; then1274 status=$? 1275 fi 1276 1277 if [ ${status} -gt 0 ] ; then 1278 1278 echo "IGCM_sys_GetBuffer : copy error." 1279 1279 cat out_rsync
Note: See TracChangeset
for help on using the changeset viewer.