Changeset 1171 for trunk/libIGCM/libIGCM_sys/libIGCM_sys_ada.ksh
- Timestamp:
- 02/13/15 15:39:23 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libIGCM/libIGCM_sys/libIGCM_sys_ada.ksh
r1163 r1171 82 82 typeset -r RSYNC_opt="-va" 83 83 # ie storage filesystem 84 ###typeset -r STOREHOST=gaya85 84 typeset -r STOREHOST=ergon 86 85 typeset -r REMOTE_RSYNC=/u/rech/ces/rces452/RSYNC/bin/rsync … … 247 246 function IGCM_sys_RshArchive { 248 247 IGCM_debug_PushStack "IGCM_sys_RshArchive" $@ 249 typeset ergonCount gayaCount250 248 DEBUG_sys=false IGCM_sys_IsFileArchived "$@" 251 if [ $? = 0 ] ; then 252 status=0 253 #special case for the find command. Only used together with RshArchive to find tared restart 254 if [ "X$( echo $@ | grep ^find | grep RESTART )" != "X" ] ; then 255 # Ergon first 256 rsh ${STOREHOST} exec /bin/ksh <<-EOF > ergonList.txt 257 ${@} 258 EOF 259 (( status=status + $? )) 260 # Gaya turn 261 rsh gaya exec /bin/ksh <<-EOF > gayaList.txt 262 ${@} 263 EOF 264 (( status=status + $? )) 265 266 # the more the better 267 ergonCount=$( cat ergonList.txt | wc -l ) 268 gayaCount=$( cat gayaList.txt | wc -l ) 269 270 [ ${ergonCount} -ge ${gayaCount} ] && cat ergonList.txt || cat gayaList.txt 271 rm -f ergonList.txt gayaList.txt 272 else 249 if [ $? = 0 ] ; then 273 250 rsh ${STOREHOST} exec /bin/ksh <<-EOF 274 251 ${@} 275 252 EOF 276 253 status=$? 277 fi278 254 else 279 255 /bin/ksh <<-EOF … … 552 528 fi 553 529 typeset IsArchivedFlag 554 IsArchivedFlag=$( ( [ "X$( echo $@ | grep \/u\/ )" != "X" ] || [ "X$( echo $@ | grep \/\arch\/home )" != "X" ] )&& echo 0 || echo 1 )530 IsArchivedFlag=$( [ "X$( echo $@ | grep \/arch\/home )" != "X" ] && echo 0 || echo 1 ) 555 531 IGCM_debug_PopStack "IGCM_sys_IsFileArchived" 556 532 … … 565 541 function IGCM_sys_TestFileArchive { 566 542 IGCM_debug_PushStack "IGCM_sys_TestFileArchive" $@ 567 typeset ExistFlag TempCommandFile 568 TempCommandFile="[ -f $1 ] && echo 0 || echo 1" 569 #Command depends on targeted file system 570 #We want it quiet 571 DEBUG_sys=false IGCM_sys_IsFileArchived $1 572 if [ $? = 0 ] ; then 573 ExistFlag=$( IGCM_sys_RshArchive ${TempCommandFile} ) 574 else 575 ExistFlag=$( ${TempCommandFile} ) 576 fi 543 typeset ExistFlag 544 ExistFlag=$( IGCM_sys_RshArchive "[ -f $1 ] && echo 0 || echo 1" ) 577 545 IGCM_debug_PopStack "IGCM_sys_TestFileArchive" 578 546 579 547 return ${ExistFlag} 580 548 } 581 582 #D-#==================================================583 #D-function IGCM_sys_TestFileArchive584 #D-* Purpose: Test file that must NOT EXISTS on Archive585 #D-* Examples:586 #D-587 #function IGCM_sys_TestFileArchive {588 # IGCM_debug_PushStack "IGCM_sys_TestFileArchive" $@589 # typeset ExistFlag finalPosition590 #591 # DEBUG_sys=false IGCM_sys_IsFileArchived $1592 # if [ $? = 0 ] ; then593 # finalPosition=$( mfls $1 2>/dev/null | wc -l )594 # [ ${finalPosition} -eq 4 ] && ExistFlag=1 || ExistFlag=0595 # else596 # ExistFlag=$( [ -f $1 ] && echo 0 || echo 1 )597 # fi598 #599 # IGCM_debug_PopStack "IGCM_sys_TestFileArchive"600 #601 # return ${ExistFlag}602 #}603 549 604 550 #D-#================================================== … … 637 583 IGCM_debug_PopStack "IGCM_sys_CountFileArchive" 638 584 } 639 640 #D-#==================================================641 #D-function IGCM_sys_CountFileArchive642 #D-* Purpose: Count files on Archive filesystem643 #D-* Examples:644 #D-645 #function IGCM_sys_CountFileArchive {646 # IGCM_debug_PushStack "IGCM_sys_CountFileArchive" $@647 # typeset status gayaPosition ergonPosition finalPosition gayaCount ergonCount648 # #Command depends on targeted file system649 # DEBUG_sys=false IGCM_sys_IsFileArchived $1650 # if [ $? = 0 ] ; then651 # status=0652 # gayaPosition=$( mfls ${@} 2>/dev/null | grep -n "++ Gaya" | awk -F\: {'print $1'} )653 # (( status=status + $? ))654 # ergonPosition=$( mfls ${@} 2>/dev/null | grep -n "++ Ergon" | awk -F\: {'print $1'} )655 # (( status=status + $? ))656 # finalPosition=$( mfls ${@} 2>/dev/null | wc -l )657 # (( status=status + $? ))658 659 # (( gayaCount = ergonPosition - gayaPosition - 2 ))660 # (( ergonCount = finalPosition - ergonPosition ))661 662 # # return number of files found. greater the better663 # [ ${ergonCount} -ge ${gayaCount} ] && echo ${ergonCount} || echo ${gayaCount}664 665 # # "Ergon only" case666 # #IGCM_sys_RshArchive "ls ${@} 2>/dev/null | wc -l"667 # #status=$?668 # else669 # ls ${@} 2>/dev/null | wc -l670 # status=$?671 # fi672 # if [ ${status} -gt 0 ] ; then673 # echo "IGCM_sys_CountFileArchive : erreur."674 # fi675 # IGCM_debug_PopStack "IGCM_sys_CountFileArchive"676 #}677 585 678 586 #D-#==================================================
Note: See TracChangeset
for help on using the changeset viewer.