Changeset 1822 for TOOLS/PACK_IPSL/enlarge_my_files.sh
- Timestamp:
- 07/19/12 16:02:21 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TOOLS/PACK_IPSL/enlarge_my_files.sh
r1768 r1822 89 89 } 90 90 91 # gpdebug : pour test showPackProgress.sh ************************* 92 export RANDOM=$$ 93 94 function gives_0_or_1 95 { 96 bit=-1 97 let "bit = RANDOM % 2" 98 echo $bit 99 } 100 101 resultCmd= 102 # gpdebug : ****************************** fin ******************** 103 104 105 #********** gpdebug : mesure d'intervalles de temps *************** 106 function getDateMilliSeconds 107 { 108 test=`date +%s%N` 109 testnum=${#test} 110 millisec=${test:0:$testnum-6} 111 echo "$millisec" 112 } 113 114 function getTimeDiffSeconds 115 { 116 startTimeMilliSec=$1 117 endTimeMilliSec=$( getDateMilliSeconds ) 118 119 diffMilliSec=$(( $endTimeMilliSec - $startTimeMilliSec )) 120 121 diffSeconds=$(awk 'BEGIN { print '$diffMilliSec'/'1000' }') 122 echo "$diffSeconds" 123 124 } 125 # gpdebug : ****************************** fin ******************** 91 126 #------------------------------------------------------ 92 127 for set in $( ls $PATH_SIMU/output_ncrcat/*list ) ; do … … 158 193 # Try 2 times before fire "FAILED" 159 194 ncrcatcmd=ncrcat 160 ncrcatoptions="--md5_digest" 161 # ncrcatoptions="" 162 163 cat $set | $ncrcatcmd $ncrcatoptions -O -x -v $varstoexclude -o $outputfile > $logfile 2>&1 195 # ncrcatoptions="--md5_digest" 196 ncrcatoptions="" 197 198 startTime=$( getDateMilliSeconds ) # gpdebug : time 199 cat $set | $ncrcatcmd $ncrcatoptions -O -x -v $varstoexclude -o $outputfile > $logfile 2>&1 # gpdebug : a retablir 200 meantime=$( getTimeDiffSeconds $startTime ) # gpdebug : time 201 202 # resultCmd=$( gives_0_or_1 ) 203 # resultCmd=1 204 # if [ $resultCmd -eq 0 ] ; then 164 205 if [ $? -eq 0 ] ; then 206 sed -i "1i\meantime:${meantime}" $statusfile # gpdebug : time 165 207 datestr2=`LC_ALL=C date +"%Y-%m-%dT%H:%M:%S"` 166 208 echo "DONE ; $datestr1 ; $datestr2 ; cat $set | $ncrcatcmd $ncrcatoptions -O -x -v '$varstoexclude' -o $outputfile ; $logfile ; $extratar" >> $statusfile … … 169 211 else 170 212 # Add --md5_digest 171 cat $set | $ncrcatcmd $ncrcatoptions -O -x -v $varstoexclude -o $outputfile > $logfile 2>&1 213 startTime=$( getDateMilliSeconds ) # gpdebug : time 214 cat $set | $ncrcatcmd $ncrcatoptions -O -x -v $varstoexclude -o $outputfile > $logfile 2>&1 # gpdebug : a retablir 215 meantime=$( getTimeDiffSeconds $startTime ) # gpdebug : time 216 # resultCmd=$( gives_0_or_1 ) 217 # resultCmd=1 218 # if [ $resultCmd -eq 0 ] ; then 172 219 if [ $? -eq 0 ] ; then 220 sed -i "1i\meantime:${meantime}" $statusfile # gpdebug : time 173 221 datestr2=`LC_ALL=C date +"%Y-%m-%dT%H:%M:%S"` 174 222 echo "DONE ; $datestr1 ; $datestr2 ; cat $set | $ncrcatcmd $ncrcatoptions -O -x -v '$varstoexclude' -o $outputfile ; $logfile ; $extratar" >> $statusfile … … 178 226 datestr2=`LC_ALL=C date +"%Y-%m-%dT%H:%M:%S"` 179 227 echo "====> FAILED at try #$nbtries" 180 echo "FAILED ; $datestr1 ; $datestr2 ; cat $set | $ncrcatcmd $ncrcatoptions -O -x -v '$varstoexclude' -o $outputfile ; $logfile ; $extratar" >> $statusfile228 echo "FAILED at try #$nbtries ; $datestr1 ; $datestr2 ; cat $set | $ncrcatcmd $ncrcatoptions -O -x -v '$varstoexclude' -o $outputfile ; $logfile ; $extratar" >> $statusfile 181 229 if [ $nbtries -ge $maxtries ] ; then 182 230 echo "====> DELEGATE to tar command after $nbtries tries (maxtries=$maxtries)" 183 231 echo "DELEGATE to tar command after $nbtries tries (maxtries=$maxtries)" >> $statusfile 184 cp $set $PATH_SIMU/output_tar232 # cp $set $PATH_SIMU/output_tar # gpdebug : a retablir 185 233 fi 186 234 fi … … 238 286 # Waiting for CCRT command 239 287 tarcmd=tar 240 taroptions="--format=posix -W -cf"241 288 # taroptions="--format=posix -W -cf" 289 taroptions="--format=posix -cf" 242 290 cd $dirinputfile 243 291 … … 248 296 249 297 # #----------------------------------- 250 251 $tarcmd $taroptions $outputfile --dereference --files-from $set.local > $logfile 2>&1 298 startTime=$( getDateMilliSeconds ) # gpdebug : time 299 $tarcmd $taroptions $outputfile --dereference --files-from $set.local > $logfile 2>&1 # gpdebug : a retablir 300 meantime=$( getTimeDiffSeconds $startTime ) # gpdebug : time 301 302 # resultCmd=$( gives_0_or_1 ) 303 # if [ $resultCmd -eq 0 ] ; then 252 304 if [ $? -eq 0 ] ; then 305 sed -i "1i\meantime:${meantime}" $statusfile # gpdebug : time 253 306 datestr2=`LC_ALL=C date +"%Y-%m-%dT%H:%M:%S"` 254 307 echo "DONE ; $datestr1 ; $datestr2 ; $tarcmd $taroptions $outputfile $(cat $set); $logfile" >> $statusfile … … 258 311 datestr2=`LC_ALL=C date +"%Y-%m-%dT%H:%M:%S"` 259 312 echo "====> FAILED at try #$nbtries" 260 echo "FAILED ; $datestr1 ; $datestr2 ; $tarcmd $taroptions $outputfile $(cat $set) ; $logfile" >> $statusfile313 echo "FAILED at try #$nbtries ; $datestr1 ; $datestr2 ; $tarcmd $taroptions $outputfile $(cat $set) ; $logfile" >> $statusfile 261 314 262 315 fi … … 314 367 # Waiting for CCRT command 315 368 tarcmd=tar 316 taroptions="--format=posix -W -cf"317 369 # taroptions="--format=posix -W -cf" 370 taroptions="--format=posix -cf" 318 371 cd $dirin1 319 372 # ls 320 373 321 $tarcmd $taroptions $outputfile --dereference --files-from $set > $logfile 2>&1 374 startTime=$( getDateMilliSeconds ) # gpdebug : time 375 $tarcmd $taroptions $outputfile --dereference --files-from $set > $logfile 2>&1 # gpdebug : a retablir 376 meantime=$( getTimeDiffSeconds $startTime ) # gpdebug : time 377 378 # resultCmd=$( gives_0_or_1 ) 379 # if [ $resultCmd -eq 0 ] ; then 322 380 if [ $? -eq 0 ] ; then 381 sed -i "1i\meantime:${meantime}" $statusfile # gpdebug : time 323 382 datestr2=`LC_ALL=C date +"%Y-%m-%dT%H:%M:%S"` 324 383 echo "DONE ; $datestr1 ; $datestr2 ; $tarcmd $taroptions $outputfile $(cat $set); $logfile" >> $statusfile … … 328 387 datestr2=`LC_ALL=C date +"%Y-%m-%dT%H:%M:%S"` 329 388 echo "====> FAILED at try #$nbtries" 330 echo "FAILED ; $datestr1 ; $datestr2 ; $tarcmd $taroptions $outputfile $(cat $set) ; $logfile" >> $statusfile389 echo "FAILED at try #$nbtries ; $datestr1 ; $datestr2 ; $tarcmd $taroptions $outputfile $(cat $set) ; $logfile" >> $statusfile 331 390 332 391 fi … … 382 441 # Waiting for CCRT command 383 442 tarcmd=tar 384 taroptions="--format=posix -W -cf"385 443 # taroptions="--format=posix -W -cf" 444 taroptions="--format=posix -cf" 386 445 cd $dirin1 387 446 # ls 388 389 $tarcmd $taroptions $outputfile --dereference --files-from $set > $logfile 2>&1 447 448 startTime=$( getDateMilliSeconds ) # gpdebug : time 449 $tarcmd $taroptions $outputfile --dereference --files-from $set > $logfile 2>&1 # gpdebug : a retablir 450 meantime=$( getTimeDiffSeconds $startTime ) # gpdebug : time 451 452 # resultCmd=$( gives_0_or_1 ) 453 # if [ $resultCmd -eq 0 ] ; then 390 454 if [ $? -eq 0 ] ; then 455 sed -i "1i\meantime:${meantime}" $statusfile # gpdebug : time 391 456 datestr2=`LC_ALL=C date +"%Y-%m-%dT%H:%M:%S"` 392 457 echo "DONE ; $datestr1 ; $datestr2 ; $tarcmd $taroptions $outputfile $(cat $set); $logfile" >> $statusfile … … 396 461 datestr2=`LC_ALL=C date +"%Y-%m-%dT%H:%M:%S"` 397 462 echo "====> FAILED at try #$nbtries" 398 echo "FAILED ; $datestr1 ; $datestr2 ; $tarcmd $taroptions $outputfile $(cat $set) ; $logfile" >> $statusfile463 echo "FAILED at try #$nbtries ; $datestr1 ; $datestr2 ; $tarcmd $taroptions $outputfile $(cat $set) ; $logfile" >> $statusfile 399 464 400 465 fi … … 447 512 cpcmd="cp " 448 513 cpoptions="-rf" 449 $cpcmd $cpoptions $file $diroutputfile > $logfile 2>&1 514 startTime=$( getDateMilliSeconds ) # gpdebug : time 515 $cpcmd $cpoptions $file $diroutputfile > $logfile 2>&1 # gpdebug : a retablir 516 meantime=$( getTimeDiffSeconds $startTime ) # gpdebug : time 450 517 done 451 518 519 # resultCmd=$( gives_0_or_1 ) 520 # if [ $resultCmd -eq 0 ] ; then 452 521 if [ $? -eq 0 ] ; then 522 sed -i "1i\meantime:${meantime}" $statusfile # gpdebug : time 453 523 datestr2=`LC_ALL=C date +"%Y-%m-%dT%H:%M:%S"` 454 524 echo "DONE ; $datestr1 ; $datestr2 ; $cpcmd $cpoptions $file $diroutputfile ; $logfile" >> $statusfile … … 458 528 datestr2=`LC_ALL=C date +"%Y-%m-%dT%H:%M:%S"` 459 529 echo "====> FAILED at try #$nbtries" 460 echo "FAILED ; $datestr1 ; $datestr2 ; $cpcmd $cpoptions $file $diroutputfile ; $logfile" >> $statusfile530 echo "FAILED at try #$nbtries ; $datestr1 ; $datestr2 ; $cpcmd $cpoptions $file $diroutputfile ; $logfile" >> $statusfile 461 531 462 532 fi … … 509 579 cpcmd="cp " 510 580 cpoptions="-rf" 511 $cpcmd $cpoptions $file $diroutputfile > $logfile 2>&1 581 startTime=$( getDateMilliSeconds ) # gpdebug : time 582 $cpcmd $cpoptions $file $diroutputfile > $logfile 2>&1 # gpdebug : a retablir 583 meantime=$( getTimeDiffSeconds $startTime ) # gpdebug : timeS 512 584 done 513 585 586 # resultCmd=$( gives_0_or_1 ) 587 # if [ $resultCmd -eq 0 ] ; then 514 588 if [ $? -eq 0 ] ; then 589 sed -i "1i\meantime:${meantime}" $statusfile # gpdebug : time 515 590 datestr2=`LC_ALL=C date +"%Y-%m-%dT%H:%M:%S"` 516 591 echo "DONE ; $datestr1 ; $datestr2 ; $cpcmd $cpoptions $file $diroutputfile ; $logfile" >> $statusfile … … 520 595 datestr2=`LC_ALL=C date +"%Y-%m-%dT%H:%M:%S"` 521 596 echo "====> FAILED at try #$nbtries" 522 echo "FAILED ; $datestr1 ; $datestr2 ; $cpcmd $cpoptions $file $diroutputfile ; $logfile" >> $statusfile597 echo "FAILED at try #$nbtries ; $datestr1 ; $datestr2 ; $cpcmd $cpoptions $file $diroutputfile ; $logfile" >> $statusfile 523 598 524 599 fi
Note: See TracChangeset
for help on using the changeset viewer.