Ignore:
Timestamp:
08/24/06 12:15:46 (18 years ago)
Author:
Daniela Dorner
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/datacenter/scripts/dodatacheck

    r7920 r7927  
    5151date >> $scriptlog 2>&1
    5252
    53 # get todo file
    54 possibletodofiles=`ls -r $listpath/ToDo-*-$column-*.txt`  >> $scriptlog 2>&1
    55 if [ "$possibletodofiles" = "" ]
    56 then
    57    echo "ERROR: in $program no todofiles found => something went wrong in jobmanager"
    58    finish >> $scriptlog 2>&1
    59 else
    60    singleprocess="yes"
    61    echo "todofiles: "${possibletodofiles[@]} >> $scriptlog 2>&1
    62    for possibletodofile in ${possibletodofiles[@]}
    63    do
    64       if ! ls $possibletodofile >> $scriptlog 2>&1
    65       then
    66          echo "file is not on disk -> continue" >> $scriptlog 2>&1
    67          continue
    68       fi
    69       lockfile=`echo $possibletodofile | sed -e 's/lists/locks/' -e 's/ToDo/lock/'`
    70       checklock >> $scriptlog 2>&1
    71       todofile=$possibletodofile
    72    done
    73 fi
    74 if [ "$todofile" = "" ]
    75 then
    76    echo "no todofile found -> exit"  >> $scriptlog 2>&1
    77    finish >> $scriptlog 2>&1
    78 fi
     53# get run #
     54gettodo >> $scriptlog 2>&1
     55run=$process
    7956
    80 # get run(s) from todo file
    81 runs=(`cat $todofile`)
    82 if [ "$runs" = "" ]
    83 then
    84    echo "nothing to do -> exit"  >> $scriptlog 2>&1
    85    finish >> $scriptlog 2>&1
    86 fi
    87 echo "runs: "${runs[@]} >> $scriptlog 2>&1
    88 rm -v $todofile >> $scriptlog 2>&1
     57# lock sequ
     58lockfile=$lockpath/lock-$table-$column-$run.txt
     59checklock >> $scriptlog 2>&1
    8960
    9061cd $mars
    9162
    92 # processing run(s)
    93 for run in ${runs[@]}
     63echo "do $program for run "$run >> $scriptlog 2>&1
     64no=`printf %08d $run | cut -c 0-2`
     65no2=`printf %08d $run`
     66var1=$date
     67var2=$no2
     68rawfile=`find /magic/data/rawfiles/ -name *${run}_[D,P,C,S]_*_E.raw -o -name *${run}_[D,P,C,S]_*_E.raw.gz`
     69echo "rawfile: "$rawfile >> $scriptlog 2>&1
     70date=`echo $rawfile | cut -c 22-31`
     71# for sinope the date is needed in the format YYYY-MM-DD
     72date2=`echo $date | sed -e 's/\//-/g'`
     73
     74setstatus "start" >> $scriptlog 2>&1
     75
     76# running filldotraw
     77echo "doing filldotraw..." >> $scriptlog 2>&1
     78filldotrawpath=$logpath/filldotraw/$date
     79makedir $filldotrawpath >> $scriptlog 2>&1
     80filldotrawlogfile=$filldotrawpath/filldotraw-$no2.log
     81
     82check1=`root -q -b $macrospath/filldotraw.C+\("\"$rawfile\""\,kFALSE\) | tee $filldotrawlogfile | grep int | sed -e 's/.*(int)//'`
     83
     84case $check1 in
     85   1)   echo " check1=$check1 -> everything ok -> go on with $program..." >> $scriptlog 2>&1
     86        ;;
     87   0)   echo " check1=$check1 -> no connection to db -> continue..." >> $scriptlog 2>&1
     88        check="no"
     89        setstatus "stop" >> $scriptlog 2>&1
     90        continue ;;
     91   *)   echo " check1=$check1 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1
     92        com=$Ffillraw
     93        check=$check1
     94        setstatus "stop" >> $scriptlog 2>&1
     95        continue ;;
     96esac
     97
     98# running sinope
     99sinopepath=$datapath/sinope/$date
     100makedir $sinopepath >> $scriptlog 2>&1
     101
     102sins=( "-dat"  "-cal")
     103for sin in ${sins[@]}
    94104do
    95    echo "do $program for run "$run >> $scriptlog 2>&1
    96    no=`printf %08d $run | cut -c 0-2`
    97    no2=`printf %08d $run`
    98    var1=$date
    99    var2=$no2
    100    rawfile=`find /magic/data/rawfiles/ -name *${run}_[D,P,C,S]_*_E.raw -o -name *${run}_[D,P,C,S]_*_E.raw.gz`
    101    echo "rawfile: "$rawfile >> $scriptlog 2>&1
    102    date=`echo $rawfile | cut -c 22-31`
    103    # for sinope the date is needed in the format YYYY-MM-DD
    104    date2=`echo $date | sed -e 's/\//-/g'`
     105   sinopefile=sinope$sin$no2
     106   
     107   echo "running sinope $sin..." >> $scriptlog 2>&1
     108   ./sinope -b -q -v4 -f $sin --outf=$sinopefile --out=$sinopepath --log=$sinopepath/$sinopefile.log --html=$sinopepath/$sinopefile.html --run=$run --date=$date2  2>> $scriptlog > /dev/null
     109   check2=$?
     110   
     111   case $check2 in
     112       0)   echo " check2=$check2 -> everything ok -> go on with $program..." >> $scriptlog 2>&1
     113            ;;
     114       *)   echo " check2=$check2 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1
     115            com=$Fsinope
     116#            comadd=
     117            check=$check2
     118            setstatus "stop" >> $scriptlog 2>&1
     119            continue 2;;
     120   esac
     121   check2=1
     122done
    105123
    106    setstatus "start" >> $scriptlog 2>&1
     124# running fillsinope
     125fillsinopepath=$logpath/fillsinope/$date
     126makedir $fillsinopepath >> $scriptlog 2>&1
     127fillsinopelogfile=$fillsinopepath/fillsinope-$no2.log
    107128
    108    # running filldotraw
    109    echo "doing filldotraw..." >> $scriptlog 2>&1
    110    filldotrawpath=$logpath/filldotraw/$date
    111    makedir $filldotrawpath >> $scriptlog 2>&1
    112    filldotrawlogfile=$filldotrawpath/filldotraw-$no2.log
     129echo "doing fillsinope..." >> $scriptlog 2>&1
     130check3=`root -q -b $macrospath/fillsinope.C+\($run\,"\"$datapath\""\,kFALSE\) | tee $fillsinopelogfile | grep int | sed -e 's/.*(int)//'`
    113131
    114    check1=`root -q -b $macrospath/filldotraw.C+\("\"$rawfile\""\,kFALSE\) | tee $filldotrawlogfile | grep int | sed -e 's/.*(int)//'`
     132case $check3 in
     133   1)   echo " check3=$check3 -> everything ok -> set status..." >> $scriptlog 2>&1
     134        ;;
     135   0)   echo " check3=$check3 -> no connection to db -> continue..." >> $scriptlog 2>&1
     136        check="no"
     137        setstatus "stop" >> $scriptlog 2>&1
     138        continue ;;
     139   *)   echo " check3=$check3 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1
     140        com=$Ffillsinope
     141        check=$check3
     142        setstatus "stop" >> $scriptlog 2>&1
     143        continue ;;
     144esac
    115145
    116    case $check1 in
    117       1)   echo " check1=$check1 -> everything ok -> go on with $program..." >> $scriptlog 2>&1
    118            ;;
    119       0)   echo " check1=$check1 -> no connection to db -> continue..." >> $scriptlog 2>&1
    120            check="no"
    121            setstatus "stop" >> $scriptlog 2>&1
    122            continue ;;
    123       *)   echo " check1=$check1 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1
    124            com=$Ffillraw
    125            check=$check1
    126            setstatus "stop" >> $scriptlog 2>&1
    127            continue ;;
    128    esac
    129    
    130    # running sinope
    131    sinopepath=$datapath/sinope/$date
    132    makedir $sinopepath >> $scriptlog 2>&1
    133    
    134    sins=( "-dat"  "-cal")
    135    for sin in ${sins[@]}
    136    do
    137       sinopefile=sinope$sin$no2
    138      
    139       echo "running sinope $sin..." >> $scriptlog 2>&1
    140       ./sinope -b -q -v4 -f $sin --outf=$sinopefile --out=$sinopepath --log=$sinopepath/$sinopefile.log --html=$sinopepath/$sinopefile.html --run=$run --date=$date2  2>> $scriptlog > /dev/null
    141       check2=$?
    142      
    143       case $check2 in
    144           0)   echo " check2=$check2 -> everything ok -> go on with $program..." >> $scriptlog 2>&1
    145                ;;
    146           *)   echo " check2=$check2 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1
    147                com=$Fsinope
    148 #               comadd=
    149                check=$check2
    150                setstatus "stop" >> $scriptlog 2>&1
    151                continue 2;;
    152       esac
    153       check2=1
    154    done
    155    
    156    # running fillsinope
    157    fillsinopepath=$logpath/fillsinope/$date
    158    makedir $fillsinopepath >> $scriptlog 2>&1
    159    fillsinopelogfile=$fillsinopepath/fillsinope-$no2.log
     146# resetting the status for exclusions
     147echo "resetting the status for fExclusionsDone for date $date2" >> $scriptlog 2>&1
     148resetlogpath=$logpath/resetexclusions/$date
     149makedir $resetlogpath >> $scriptlog 2>&1
     150resetlog=$resetlogpath/reset-exclusions-$no2-$date2.log
    160151
    161    echo "doing fillsinope..." >> $scriptlog 2>&1
    162    check3=`root -q -b $macrospath/fillsinope.C+\($run\,"\"$datapath\""\,kFALSE\) | tee $fillsinopelogfile | grep int | sed -e 's/.*(int)//'`
     152check5=`root -q -b $macrospath/resetcolumn.C+\("\"fExclusionsDone\""\,"\"SequenceBuildStatus\""\,"\"$date2\""\,"\"$date2\""\,kFALSE\) | tee $resetlog | grep int | sed -e 's/(int)//'`
     153case $check5 in
     154   1)   echo " check5=$check5 -> everything ok, fExclusions have been reset " >> $scriptlog 2>&1
     155        ;;
     156   0)   echo " check5=$check5 -> no connection to db -> continue..." >> $scriptlog 2>&1
     157        check="no"
     158        setstatus "stop" >> $scriptlog 2>&1
     159        continue ;;
     160   *)   echo " check5=$check5 -> ERROR -> step could not be resetted -> repeat step " >> $scriptlog 2>&1
     161        com=$Fresetexcl
     162        comadd=`echo $date2 | sed -e 's/-//g'`
     163        check=$check5
     164        setstatus "stop" >> $scriptlog 2>&1
     165        continue ;;
     166esac
    163167
    164    case $check3 in
    165       1)   echo " check3=$check3 -> everything ok -> set status..." >> $scriptlog 2>&1
    166            ;;
    167       0)   echo " check3=$check3 -> no connection to db -> continue..." >> $scriptlog 2>&1
    168            check="no"
    169            setstatus "stop" >> $scriptlog 2>&1
    170            continue ;;
    171       *)   echo " check3=$check3 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1
    172            com=$Ffillsinope
    173            check=$check3
    174            setstatus "stop" >> $scriptlog 2>&1
    175            continue ;;
    176    esac
    177 
    178    # resetting the status for exclusions
    179    echo "resetting the status for fExclusionsDone for date $date2" >> $scriptlog 2>&1
    180    resetlogpath=$logpath/resetexclusions/$date
    181    makedir $resetlogpath >> $scriptlog 2>&1
    182    resetlog=$resetlogpath/reset-exclusions-$no2-$date2.log
    183 
    184    check5=`root -q -b $macrospath/resetcolumn.C+\("\"fExclusionsDone\""\,"\"SequenceBuildStatus\""\,"\"$date2\""\,"\"$date2\""\,kFALSE\) | tee $resetlog | grep int | sed -e 's/(int)//'`
    185    case $check5 in
    186       1)   echo " check5=$check5 -> everything ok, fExclusions have been reset " >> $scriptlog 2>&1
    187            ;;
    188       0)   echo " check5=$check5 -> no connection to db -> continue..." >> $scriptlog 2>&1
    189            check="no"
    190            setstatus "stop" >> $scriptlog 2>&1
    191            continue ;;
    192       *)   echo " check5=$check5 -> ERROR -> step could not be resetted -> repeat step " >> $scriptlog 2>&1
    193            com=$Fresetexcl
    194            comadd=`echo $date2 | sed -e 's/-//g'`
    195            check=$check5
    196            setstatus "stop" >> $scriptlog 2>&1
    197            continue ;;
    198    esac
    199 
    200    # set status
    201    statustime="Now()"
    202    failed="NULL"
    203    starttime="NULL"
    204    failedtime="NULL"
    205    var1=$date
    206    var2=$no2
    207    setstatus "stop" >> $scriptlog 2>&1
     168# set status
     169statustime="Now()"
     170failed="NULL"
     171starttime="NULL"
     172failedtime="NULL"
     173var1=$date
     174var2=$no2
     175setstatus "stop" >> $scriptlog 2>&1
    208176done
    209177
Note: See TracChangeset for help on using the changeset viewer.