Ignore:
Timestamp:
08/25/06 22:09:49 (18 years ago)
Author:
Daniela Dorner
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/datacenter/scripts
Files:
33 edited

Legend:

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

    r7938 r7944  
    3535#
    3636
     37source `dirname $0`/sourcefile
     38printprocesslog "INFO starting $0"
    3739program=buildsequenceentries
    38 source `dirname $0`/sourcefile
     40column=fSequenceEntriesBuilt
    3941
    4042set -C
    4143
    42 column=fSequenceEntriesBuilt
    43 
    44 lockfile=$lockpath/lock-$program.txt
    45 
    46 scriptlogpath=$runlogpath/$program
    47 makedir $scriptlogpath
    48 scriptlog=$scriptlogpath/$program-$datetime.log
    49 
     44scriptlog=$runlogpath/$program-$datetime.log
    5045date >> $scriptlog 2>&1
    5146
    5247# check if script is already running
     48lockfile=$lockpath/lock-$program.txt
    5349checklock  >> $scriptlog 2>&1
    5450
     
    7167do
    7268   echo "building sequence entries for date $date..." >> $scriptlog 2>&1
     69   printprocesslog "INFO build sequence entries for $date"
    7370   year2=`echo $date | cut -c 1-4`
    7471   var1=$year2
     
    8380
    8481   case $check1 in
    85       1)   echo " check1=$check1 -> everything ok -> setting status for $date..." >> $scriptlog 2>&1;;
     82      1)   echo " check1=$check1 -> everything ok -> setting status for $date..." >> $scriptlog 2>&1
     83           printprocesslog "INFO sequence entries successfully built for $date"
     84           ;;
    8685      0)   echo " check1=$check1 -> no connection to db -> continue..." >> $scriptlog 2>&1
     86           printprocesslog "WARN connection to DB failed"
    8787           check="no"
    8888           ;;
    8989      *)   echo " check1=$check1 -> ERROR - $program.C failed for $date -> step has to be repeated" >> $scriptlog 2>&1
     90           printprocesslog "ERROR $program.C failed for $date"
    9091           com=$Fbuildsequ
    9192           check=$check1
  • trunk/MagicSoft/Mars/datacenter/scripts/checkfilesforsequenceavail

    r7938 r7944  
    3535#
    3636
     37source `dirname $0`/sourcefile
     38printprocesslog "INFO starting $0"
    3739program=checkfilesavail
    38 source `dirname $0`/sourcefile
    39 
    4040column=fAllFilesAvail
    4141
    42 lockfile=$lockpath/lock-$program.txt
    43 
    44 scriptlogpath=$runlogpath/$program
    45 makedir $scriptlogpath
    46 scriptlog=$scriptlogpath/$program-$datetime.log
    47 
     42scriptlog=$runlogpath/$program-$datetime.log
    4843date >> $scriptlog 2>&1
    4944
    5045# check if script is already running
     46lockfile=$lockpath/lock-$program.txt
    5147checklock  >> $scriptlog 2>&1
    5248
     
    6965do
    7066   echo "checking files for sequence $sequence..." >> $scriptlog 2>&1
     67   printprocesslog "INFO checking files for sequence $sequence"
    7168   no=`printf %08d $sequence | cut -c 0-4`
    7269   no2=`printf %08d $sequence`
     
    8481
    8582   case $check1 in
    86       1)   echo " check1=$check1 -> everything ok -> setting status..." >> $scriptlog 2>&1 ;;
     83      1)   echo " check1=$check1 -> everything ok -> setting status..." >> $scriptlog 2>&1
     84           printprocesslog "INFO files available for sequence $sequence"
     85           ;;
    8786      2)   echo " check1=$check1 -> files not yet available -> continue..." >> $scriptlog 2>&1
     87           printprocesslog "INFO files not yet available for sequence $sequence"
    8888           check="no"
    8989           ;;
    9090      0)   echo " check1=$check1 -> no connection to db -> continue..." >> $scriptlog 2>&1
     91           printprocesslog "WARN connection to DB failed"
    9192           check="no"
    9293           ;;
    93       *)   echo "check1=$check1 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1
     94      *)   echo " check1=$check1 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1
     95           printprocesslog "ERROR $program.C failed"
    9496           com=$Ffilesavail
    9597           check=$check1
  • trunk/MagicSoft/Mars/datacenter/scripts/checkstardone

    r7938 r7944  
    3636#
    3737
     38source `dirname $0`/sourcefile
     39printprocesslog "INFO starting $0"
    3840program=checkstardone
    39 source `dirname $0`/sourcefile
    40 
    4141column=fStarFilesAvail
    4242
    43 lockfile=$lockpath/lock-$program.txt
    44 
    45 scriptlogpath=$runlogpath/$program
    46 makedir $scriptlogpath
    47 scriptlog=$scriptlogpath/$program-$datetime.log
    48 
     43scriptlog=$runlogpath/$program-$datetime.log
    4944date >> $scriptlog 2>&1
    5045
    5146# check if script is already running
     47lockfile=$lockpath/lock-$program.txt
    5248checklock  >> $scriptlog 2>&1
    5349
     
    6157   finish >> $scriptlog 2>&1
    6258fi
    63 echo "datasets: "${datasets[@]} #>> $scriptlog 2>&1
     59echo "datasets: "${datasets[@]} >> $scriptlog 2>&1
    6460rm -v $todofile >> $scriptlog 2>&1
    6561
     
    6864for dataset in ${datasets[@]}
    6965do
     66   echo "checking files for dataset $dataset..." >> $scriptlog 2>&1
     67   printprocesslog "INFO checking files for dataset $dataset"
    7068   no=`printf %08d $dataset | cut -c 0-5`
    7169   no2=`printf %08d $dataset`
    7270   var1=$no
    7371   var2=$dataset
    74    echo "checking files for dataset $dataset..." >> $scriptlog 2>&1
    7572   datasetfile=$datasetpath/$no/dataset`printf %08d $dataset`.txt
     73   
    7674   sequences=(`cat $datasetfile | grep Sequences | sed -e 's/SequencesOn://g' | sed -e 's/SequencesOff://g'`)
    77    
    7875   if [ "$sequences" = "" ]
    7976   then
     
    8279      continue
    8380   fi
     81   echo "sequences: "${sequences[@]} >> $scriptlog 2>&1
    8482   
    85    echo "sequences: "${sequences[@]} >> $scriptlog 2>&1
    86 
    8783   outpath=$logpath/$program/$no/$no2
    8884   makedir $outpath  >> $scriptlog 2>&1
     
    9389   do
    9490      echo "run $program for sequence $sequence..." >> $scriptlog 2>&1
     91      printprocesslog "INFO check availability for sequence $sequence"
    9592
    9693      check1=`root -q -b $macrospath/checkstardone.C+\(\""$sequence\""\) | tee $outpath/checkstardone-$sequence.log | grep int | sed -e 's/(int)//'`
     
    9996         1)   echo " check1=$check1 -> everything ok -> continue with next sequence..." >> $scriptlog 2>&1 ;;
    10097         2)   echo " check1=$check1 -> files for sequence $sequence not yet available -> continue..." >> $scriptlog 2>&1
     98              printprocesslog "INFO files not yet available for sequence $sequence"
    10199              check="no"
    102100              break
    103101              ;;
    104102         0)   echo " check1=$check1 -> no connection to db -> continue..." >> $scriptlog 2>&1
     103              printprocesslog "WARN connection to DB failed"
    105104              check="no"
    106105              break
    107106              ;;
    108107         *)   echo " check1=$check1 -> ERROR " >> $scriptlog 2>&1
     108              printprocesslog "ERROR $program.C failed"
    109109              com=$Fstardone
    110110              comadd=$sequence
  • trunk/MagicSoft/Mars/datacenter/scripts/copyscript

    r7938 r7944  
    5757#
    5858
     59source `dirname $0`/sourcefile
     60printprocesslog "INFO starting $0"
    5961program=copyscript
    60 source `dirname $0`/sourcefile
    6162
    6263set -C
     
    6768char=24
    6869datetime=`date +%F-%H-%M-%S`
    69 lockfile=$lockpath/lock-copyscript.txt
    70 
    71 scriptlogpath=$runlogpath/$program
    72 makedir $scriptlogpath
    73 
    74 scriptlog=$scriptlogpath/copyscript-$datetime.log
    75 
     70lockfile=$lockpath/lock-$program.txt
     71
     72scriptlog=$runlogpath/$program-$datetime.log
    7673date >> $scriptlog 2>&1
    7774
     
    8784then
    8885   echo "couldn't create checkfile -> exit script" >> $scriptlog 2>&1
    89    rm -v $lockfile >> $scriptlog 2>&1
    90    date  >> $scriptlog 2>&1
    91    exit
     86   finish >> $scriptlog 2>&1
    9287else
    9388   echo "checkfile created" >> $scriptlog 2>&1
     
    109104then
    110105   echo "nothing to do -> exit"  >> $scriptlog 2>&1
    111    rm -v $lockfile >> $scriptlog 2>&1
    112    date  >> $scriptlog 2>&1
    113    exit
     106   finish >> $scriptlog 2>&1
    114107fi
    115108
     
    118111for date in ${dates[@]}
    119112do
     113   printprocesslog "INFO processing files for $date"
    120114   #find all files for this date
    121115   files=`find $transdir/*/$date/ -name "*.*"`  >> $scriptlog 2>&1
     
    129123   
    130124   date2=`echo $date | sed -e 's/_/\//g'`
    131    copylogpath=$logpath/copyscript/$date2
     125   copylogpath=$logpath/$program/$date2
    132126   echo "copylogpath: "$copylogpath >> $scriptlog 2>&1
    133127   makedir $copylogpath >> $scriptlog 2>&1
     
    155149            checkfillrbk=`root -q -b $macrospath/filldotrbk.C+\("\"$file\""\,kFALSE\) | tee $copylogpath/filldotrbk-$filename-log.txt | grep int | sed -e 's/(int)//'`
    156150            case $checkfillrbk in
    157                1) echo "checkfillrbk=$checkfillrbk -> everything ok " >> $scriptlog 2>&1
    158                   echo " -> go on with copying file" >> $scriptlog 2>&1 ;;
    159                *) echo "checkfillrbk=$checkfillrbk - Error -> go on with next file" >> $scriptlog 2>&1
    160                   continue;;
     151               1) echo " checkfillrbk=$checkfillrbk -> everything ok " >> $scriptlog 2>&1
     152                  echo "  -> go on with copying file" >> $scriptlog 2>&1
     153                  ;;
     154               *) echo " checkfillrbk=$checkfillrbk - Error -> go on with next file" >> $scriptlog 2>&1
     155                  printprocesslog "ERROR filldotrbk.C failed for $file"
     156                  continue
     157                  ;;
    161158            esac
    162159         fi
     
    166163            checkfillrun=`root -q -b $macrospath/filldotrun.C+\("\"$file\""\,kFALSE\) | tee $copylogpath/filldotrun-$filename-log.txt  | grep int | sed -e 's/(int)//'`
    167164            case $checkfillrun in
    168                1) echo "checkfillrun=$checkfillrun -> everything ok " >> $scriptlog 2>&1
    169                   echo "-> insert date in SequenceBuildStatus for $date" >> $scriptlog 2>&1
     165               1) echo " checkfillrun=$checkfillrun -> everything ok " >> $scriptlog 2>&1
     166                  echo "  -> insert date in SequenceBuildStatus for $date" >> $scriptlog 2>&1
    170167
    171168                  checkinsertdate=`root -q -b $macrospath/insertdate.C+\("\"$date\""\) | tee $copylogpath/insertdate-$date-log.txt   | grep int | sed -e 's/(int)//'`
    172169                  case $checkinsertdate in
    173170                     1) echo "date inserted" >> $scriptlog 2>&1 ;;
    174                      *) echo "checkinsertdate=$checkinsertdate -> ERROR - insert date didn't work" >> $scriptlog 2>&1
    175                         continue;;
     171                     *) echo " checkinsertdate=$checkinsertdate -> ERROR - insert date didn't work" >> $scriptlog 2>&1
     172                        printprocesslog "ERROR insertdate.C failed for $date"
     173                        continue
     174                        ;;
    176175                  esac
    177                   echo " -> go on with copying file" >> $scriptlog 2>&1 ;;
    178                *) echo "checkfillrun=$checkfillrun Error -> go on with next file" >> $scriptlog 2>&1
    179                   continue;;
     176                  echo " -> go on with copying file" >> $scriptlog 2>&1
     177                  ;;
     178               *) echo " checkfillrun=$checkfillrun Error -> go on with next file" >> $scriptlog 2>&1
     179                  printprocesslog "ERROR filldotrun.C failed for $file"
     180                  continue
     181                  ;;
    180182            esac
    181183         fi
     
    189191         else
    190192            echo $file" couldn't be moved!!!!!" >> $scriptlog 2>&1
     193            printprocesslog "WARN moving of file $file didn't work"
    191194         fi
    192195
     
    195198         #already processed (entry in donelist) -> go on with next file
    196199         echo $file": checksum not ok " >> $scriptlog 2>&1
     200         printprocesslog "WARN checksum for file $file is not ok"
    197201      fi
    198202   done
     
    208212#second part of the script:
    209213#update the catalog file magic_favorites.edb
    210 
     214printprocesslog "INFO processing new catalog files"
    211215magfav=magic_favorites.edb #catalog filename
    212216catalog=$setuppath/$magfav #current catalogfile
     
    218222for catfile in ${catfiles[@]}
    219223do
     224   printprocesslog "INFO processing catalog file $catfile"
    220225   #write information into .diff
    221226   echo "diff $catfile $catalog" >| $diff
     
    240245         #inform $adrs about removed lines
    241246         nail -s 'catalogfile - removed lines' $adrs < $diff
    242          exit
     247         printprocesslog "NEWS catalog file: lines have been removed ($catfile)"
     248         finish >> $scriptlog 2>&1
    243249      fi
    244250     
     
    252258      then
    253259         echo "could not do 'rsync -av $catalog $setuppath/oldcatalogs/$magfav.$date' -> exit" >> $scriptlog 2>&1
    254          exit
     260         printprocesslog "ERROR rsync of catalog file ($catalog -> $oldcatalogpath/$magfav.$date) didn't work"
     261         finish >> $scriptlog 2>&1
    255262      fi
    256263      #rsync new catalogfile to current catalogfile
     
    258265      then
    259266         echo "could not do 'rsync -av $catfile $catalog' -> exit" >> $scriptlog 2>&1
    260          exit
     267         printprocesslog "ERROR rsync of catalog file ($catfile -> $catalog) didn't work"
     268         finish >> $scriptlog 2>&1
    261269      fi
    262270      #inform $adrs about changes
    263271      echo "file has been rsynced sucessfully -> sending email" >> $scriptlog 2>&1
    264272      nail -s 'new catalogfile installed - new lines'  $adrs < $diff
     273      printprocesslog "NEWS there are new lines in the catalogfile (see $catalog)"
    265274      continue
    266275   fi
     
    273282      #inform $adrs about removed lines
    274283      nail -s 'catalogfile - removed lines' $adrs < $diff
    275       exit
     284      printprocesslog "NEWS catalog file: lines have been removed ($catfile)"
     285      finish >> $scriptlog 2>&1
    276286   fi
    277287#   echo "nothing has changed ($catfile)"  >> $scriptlog 2>&1
    278288done
    279289
    280 
    281 rm -v $lockfile >> $scriptlog 2>&1
    282 date >> $scriptlog 2>&1
    283 
    284 set +C
     290finish >> $scriptlog 2>&1
     291
  • trunk/MagicSoft/Mars/datacenter/scripts/correcttime

    r7938 r7944  
    3737#
    3838
     39source `dirname $0`/sourcefile
     40printprocesslog "INFO starting $0"
    3941program=correct_raw_time
    40 source `dirname $0`/sourcefile
    41 
    4242column=fTimingCorrection
    4343
    44 lockfile=$lockpath/lock-$program.txt
    45 scriptlogpath=$runlogpath/$program
     44scriptlog=$runlogpath/$program-$datetime.log
     45date >> $scriptlog 2>&1
    4646
    4747if [ -e $todofile ]
    4848then
    49    echo "$program is already running -> exit"
     49   echo "$program is already running -> exit" >> $scriptlog 2>&1
    5050   exit
    5151fi
     
    5858if [ "$runs" = "" ]
    5959then
    60    echo "nothing to do -> exit"
     60   echo "nothing to do -> exit" >> $scriptlog 2>&1
    6161   finish >> $scriptlog 2>&1
    6262fi
    63 echo "runs: "${runs[@]}
    64 rm -v $todofile >> $scriptlog 2>&1
     63echo "runs: "${runs[@]} >> $scriptlog 2>&1
    6564
    6665cd $mars
     
    6867for run in ${runs[@]}
    6968do
    70   no=`printf %08d $run | cut -c 1-5`
    71   var1=$no
    72   var2=$run
    73   echo "getting path for run $run ... "
    74   infile=`find $datapath/rawfiles-wrong-timing/ -name *${run}_[D,C,P,S]_*`
    75   echo "infile:"$infile
    76   outfile=`echo $infile | sed -e 's/-wrong-timing//g'`
    77   echo "outfile:"$outfile
    78   outpath=`dirname $outfile`
    79   echo "outpath:"$outpath
    80   makedir $outpath
     69   printprocesslog "INFO run correct_raw_time for run $run"
     70   no=`printf %08d $run | cut -c 1-5`
     71   var1=$no
     72   var2=$run
     73   echo "getting path for run $run ... " >> $scriptlog 2>&1
     74   infile=`find $datapath/rawfiles-wrong-timing/ -name *${run}_[D,C,P,S]_*`
     75   echo "infile:"$infile >> $scriptlog 2>&1
     76   outfile=`echo $infile | sed -e 's/-wrong-timing//g'`
     77   echo "outfile:"$outfile >> $scriptlog 2>&1
     78   outpath=`dirname $outfile`
     79   echo "outpath:"$outpath >> $scriptlog 2>&1
     80   makedir $outpath >> $scriptlog 2>&1
    8181
    82   timecorrpath=$outpath"/timecorrlogs"
    83   echo "timecorrpath: "$timecorrpath
    84   makedir $timecorrpath
    85  
    86   check1=0
    87   echo "run $program..." >> $scriptlog 2>&1
    88   setstatus "start" >> $scriptlog 2>&1
     82   timecorrpath=$outpath"/timecorrlogs"
     83   echo "timecorrpath: "$timecorrpath >> $scriptlog 2>&1
     84   makedir $timecorrpath >> $scriptlog 2>&1
    8985
    90   /home/tape/MagicReadout/correct_raw_time $infile $outfile > $timecorrpath/$program-$run.log
    91   check1=$?
     86   check1=0
     87   echo "run $program..." >> $scriptlog 2>&1
     88   setstatus "start" >> $scriptlog 2>&1
    9289
    93   case $check1 in
    94      1)   echo "check1=$check1 -> everything ok -> setting status..." >> $scriptlog 2>&1 ;;
    95      *)   echo "check1=$check1 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1
    96           com=$Ftimecorr
    97           check=$check1
    98           ;;
    99   esac
    100   echo "inserting the status for $program for run $run into the db" >> $scriptlog 2>&1
    101   setstatus "stop" >> $scriptlog 2>&1
     90   /home/tape/MagicReadout/correct_raw_time $infile $outfile > $timecorrpath/$program-$run.log
     91   check1=$?
     92
     93   case $check1 in
     94      1)   echo " check1=$check1 -> everything ok -> setting status..." >> $scriptlog 2>&1 ;;
     95      *)   echo " check1=$check1 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1
     96           printprocesslog "ERROR $program failed"
     97           com=$Ftimecorr
     98           check=$check1
     99           ;;
     100   esac
     101   
     102   setstatus "stop" >> $scriptlog 2>&1
    102103done
    103104
  • trunk/MagicSoft/Mars/datacenter/scripts/dodatacheck

    r7938 r7944  
    4040
    4141source `dirname $0`/sourcefile
     42printprocesslog "INFO starting $0"
    4243program=datacheck
    4344column=fDataCheckDone
     
    4546set -C
    4647
    47 scriptlogpath=$runlogpath/$program
    48 makedir $scriptlogpath
    49 scriptlog=$scriptlogpath/$program-$datetime.log
    50 
     48scriptlog=$runlogpath/$program-$datetime.log
    5149date >> $scriptlog 2>&1
    5250
     
    6260
    6361echo "do $program for run "$run >> $scriptlog 2>&1
     62printprocesslog "INFO do $program for run $run"
    6463no=`printf %08d $run | cut -c 0-2`
    6564no2=`printf %08d $run`
     
    8483case $check1 in
    8584   1)   echo " check1=$check1 -> everything ok -> go on with $program..." >> $scriptlog 2>&1
     85        printprocesslog "INFO finished filldotraw.C sucessfully for $rawfile"
    8686        ;;
    8787   0)   echo " check1=$check1 -> no connection to db -> continue..." >> $scriptlog 2>&1
     88        printprocesslog "WARN connection to DB failed"
    8889        check="no"
    8990        setstatus "stop" >> $scriptlog 2>&1
    9091        continue ;;
    9192   *)   echo " check1=$check1 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1
     93        printprocesslog "ERROR filldotraw.C failed for $rawfile"
    9294        com=$Ffillraw
    9395        check=$check1
     
    9799
    98100# running sinope
     101printprocesslog "INFO running sinope for $run"
    99102sinopepath=$datapath/sinope/$date
    100103makedir $sinopepath >> $scriptlog 2>&1
     
    113116            ;;
    114117       *)   echo " check2=$check2 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1
     118            printprocesslog "ERROR sinope $sin failed for $rawfile"
    115119            com=$Fsinope
    116120#            comadd=
     
    132136case $check3 in
    133137   1)   echo " check3=$check3 -> everything ok -> set status..." >> $scriptlog 2>&1
     138        printprocesslog "INFO finished fillsinope.C sucessfully for run $run"
    134139        ;;
    135140   0)   echo " check3=$check3 -> no connection to db -> continue..." >> $scriptlog 2>&1
     141        printprocesslog "WARN connection to DB failed"
    136142        check="no"
    137143        setstatus "stop" >> $scriptlog 2>&1
    138144        continue ;;
    139145   *)   echo " check3=$check3 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1
     146        printprocesslog "ERROR fillsinope.C failed for run $run"
    140147        com=$Ffillsinope
    141148        check=$check3
     
    146153# resetting the status for exclusions
    147154echo "resetting the status for fExclusionsDone for date $date2" >> $scriptlog 2>&1
     155printprocesslog "INFO resetting fExclusions done for $date2"
    148156resetlogpath=$logpath/resetexclusions/$date
    149157makedir $resetlogpath >> $scriptlog 2>&1
     
    153161case $check5 in
    154162   1)   echo " check5=$check5 -> everything ok, fExclusions have been reset " >> $scriptlog 2>&1
     163        printprocesslog "INFO resetted fExclusions done for $date2 successfully"
    155164        ;;
    156165   0)   echo " check5=$check5 -> no connection to db -> continue..." >> $scriptlog 2>&1
     166        printprocesslog "WARN connection to DB failed"
    157167        check="no"
    158168        setstatus "stop" >> $scriptlog 2>&1
    159169        continue ;;
    160170   *)   echo " check5=$check5 -> ERROR -> step could not be resetted -> repeat step " >> $scriptlog 2>&1
     171        printprocesslog "ERROR resetcolumn.C failed for date $date2"
    161172        com=$Fresetexcl
    162173        comadd=`echo $date2 | sed -e 's/-//g'`
  • trunk/MagicSoft/Mars/datacenter/scripts/doexclusions

    r7938 r7944  
    3535#
    3636
     37source `dirname $0`/sourcefile
     38printprocesslog "INFO starting $0"
    3739program=doexclusions
    38 source `dirname $0`/sourcefile
     40column=fExclusionsDone
    3941
    4042set -C
    4143
    42 column=fExclusionsDone
    43 
    44 lockfile=$lockpath/lock-$program.txt
    45 
    46 scriptlogpath=$runlogpath/$program
    47 makedir $scriptlogpath
    48 scriptlog=$scriptlogpath/$program-$datetime.log
    49 
     44scriptlog=$runlogpath/$program-$datetime.log
    5045date >> $scriptlog 2>&1
    5146
    5247# check if the script is already running
     48lockfile=$lockpath/lock-$program.txt
    5349checklock  >> $scriptlog 2>&1
    5450
     
    7167do
    7268   echo "do exclusions for date "$date >> $scriptlog 2>&1
     69   printprocesslog "INFO do exclusions for $date"
    7370   year2=`echo $date | cut -c 1-4`
    7471   var1=$year2
     
    8380
    8481   case $check1 in
    85       1)   echo " check1=$check1 -> everything ok -> setting status..." >> $scriptlog 2>&1 ;;
     82      1)   echo " check1=$check1 -> everything ok -> setting status..." >> $scriptlog 2>&1
     83           printprocesslog "INFO exclusions successfully done for $date"
     84           ;;
     85      0)   echo " check1=$check1 -> no connection to db -> continue..." >> $scriptlog 2>&1
     86           printprocesslog "WARN connection to DB failed"
     87           check="no"
     88           ;;
    8689      *)   echo " check1=$check1 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1
     90           printprocesslog "ERROR $program.C failed"
    8791           com=$Fdoexcl
    8892           check=$check1
  • trunk/MagicSoft/Mars/datacenter/scripts/doqualityplots

    r7938 r7944  
    3333#
    3434
     35source `dirname $0`/sourcefile
     36printprocesslog "INFO starting $0"
    3537program=doqualityplots
    36 source `dirname $0`/sourcefile
    3738
    3839set -C
     
    4041cd $mars
    4142
    42 datetime=`date +%F-%H-%M-%S`
    43 
    44 scriptlogpath=$runlogpath/$program
    45 makedir $scriptlogpath
    46 
    47 scriptlog=$scriptlogpath/doqualityplots-$datetime.log
    48 
     43scriptlog=$runlogpath/$program-$datetime.log
    4944date >> $scriptlog 2>&1
    5045
    5146# check if script is already running
    52 lockfile=$lockpath/lock-doqualityplots.txt
     47lockfile=$lockpath/lock-$program.txt
    5348checklock  >> $scriptlog 2>&1
    5449
    5550# producing the plots with the values from the database
    5651echo "producing plots: " >> $scriptlog 2>&1
     52printprocesslog "INFO producing data quality plots"
    5753check0=`root -q -b $macrospath/plotdb.C+\(\) | tee -a $scriptlog | grep int | sed -e 's/.*(int)//'`
    5854
    5955case $check0 in
    60     1)   echo "check0=$check0 -> everything ok -> move files" >> $scriptlog 2>&1;;
    61     *)   echo "check0=$check0 -> ERROR -> couldn't create plots -> exit" >> $scriptlog 2>&1
    62          rm -v $lockfile >> $scriptlog 2>&1
    63          exit;;
     56    1)   echo " check0=$check0 -> everything ok -> move files" >> $scriptlog 2>&1
     57         printprocesslog "INFO plots successfully produced"
     58         ;;
     59    *)   echo " check0=$check0 -> ERROR -> couldn't create plots -> exit" >> $scriptlog 2>&1
     60         printprocesslog "ERROR producing plots failed"
     61         finish >> $scriptlog 2>&1
     62         ;;
    6463esac
    6564
    6665# making files available in the web
     66printprocesslog "INFO moving files to web"
    6767webpath=/www/htdocs/datacenter/datacheck
    6868name=plotdb
     
    8484# second part
    8585# making plots for all datasets
     86printprocesslog "INFO producing plots for datasets"
    8687datasets=`find $datapath/ganymed -name ganymed*.root | grep -v summary`
    8788
    8889for dataset in ${datasets[@]}
    8990do
     91   printprocesslog "INFO producing plots for dataset $dataset"
    9092   nr=`echo $dataset | cut -d/ -f6`
    9193   nr2=`echo $nr | cut -c 1-5`
     
    9799   rm -v $plotlog >> $scriptlog 2>&1
    98100   check1=`root -q -b $macrospath/plotdb.C+\("\"$datasetfile\""\) 2>>$plotlog | tee -a $scriptlog | grep int | sed -e 's/.*(int)//'`
    99    echo "check1: "$check1 >> $scriptlog 2>&1
     101   echo " check1: "$check1 >> $scriptlog 2>&1
    100102   newpsfile=$outpath/plotdb$nr.ps
    101103   newrootfile=$outpath/plotdb$nr.root
     
    106108done
    107109
    108 rm -v $lockfile >> $scriptlog 2>&1
     110finish >> $scriptlog 2>&1
    109111
    110 set +C
    111 
    112 date  >> $scriptlog 2>&1
    113 
  • trunk/MagicSoft/Mars/datacenter/scripts/dowebplots

    r7938 r7944  
    3232#
    3333
     34source `dirname $0`/sourcefile
     35printprocesslog "INFO starting $0"
    3436program=dowebplots
    35 source `dirname $0`/sourcefile
    3637
    3738set -C
    3839
    39 cd $mars
    40 
    41 datetime=`date +%F-%H-%M-%S`
    42 
    43 scriptlogpath=$runlogpath/$program
    44 makedir $scriptlogpath
    45 
    46 scriptlog=$scriptlogpath/dowebplots-$datetime.log
    47 
     40scriptlog=$runlogpath/$program-$datetime.log
    4841date >> $scriptlog 2>&1
    49 
    5042
    5143while getopts p: opts
     
    6557   echo "usage: $(basename $0) -p programname"   >> $scriptlog 2>&1
    6658   date  >> $scriptlog 2>&1
     59   printprocesslog "INFO finished $0"
    6760   exit
    6861fi
    6962
    7063# check if script is already running
    71 lockfile=$lockpath/lock-dowebplots-$type.txt
     64lockfile=$lockpath/lock-$program-$type.txt
    7265checklock  >> $scriptlog 2>&1
    73 
    7466
    7567#finding all rootfiles in the data directory, that were modified in the last 3 days
     
    8173then
    8274   echo "nothing to do -> exit"  >> $scriptlog 2>&1
    83    rm -v $lockfile >> $scriptlog 2>&1
    84    date  >> $scriptlog 2>&1
    85    exit
     75   finish >> $scriptlog 2>&1
    8676fi
    8777
    8878
     79cd $mars
     80
    8981#produce plots for each rootfile
     82printprocesslog "INFO procduing plots for each $type rootfile"
    9083for rootfile in ${rootfiles[@]}
    9184do
     
    120113   fi
    121114
     115   printprocesslog "INFO procduing plots for $rootfile"
    122116   echo "producing psfile..." >> $scriptlog 2>&1
    123117   ./showplot -b --save-as-ps=$psfile $rootfile >> $scriptlog 2>&1
     
    135129done
    136130
    137 rm -v $lockfile >> $scriptlog 2>&1
     131finish >> $scriptlog 2>&1
    138132
    139 set +C
    140 
    141 date  >> $scriptlog 2>&1
    142 
  • trunk/MagicSoft/Mars/datacenter/scripts/filesondisk

    r7938 r7944  
    4646
    4747source `dirname $0`/sourcefile
     48printprocesslog "INFO starting $0"
     49program=filesondisk
    4850
    4951set -C
    5052
    51 cd $mars
    52 
    53 program=filesondisk
    54 
    55 lockfile=$lockpath/lock-$program.txt
    56 
    57 scriptlogpath=$runlogpath/$program
    58 makedir $scriptlogpath
    59 scriptlog=$scriptlogpath/$program-$datetime.log
    60 
     53scriptlog=$runlogpath/$program-$datetime.log
    6154date >> $scriptlog 2>&1
    6255
    6356# check if script is already running
     57lockfile=$lockpath/lock-$program.txt
    6458checklock  >> $scriptlog 2>&1
    6559
    66 date=`date +%F`
     60filesondisklogpath=$logpath/$program/`date +%Y/%m`
     61makedir $filesondisklogpath >> $scriptlog 2>&1
    6762
    68 subsystemdir=/magic/subsystemdata
    69 filesondisklogpath=$logpath/$program/`date +%Y/%m`
    70 makedir $filesondisklogpath
    71 
     63cd $mars
    7264
    7365echo "checking disk for ccfiles..."  >> $scriptlog 2>&1
     66printprocesslog "INFO checking ccfiles"
    7467filename=$filesondisklogpath/ccfilesondisk-$datetime.txt
    7568column=fCCFileAvail
    76 find $subsystemdir/cc/ -name '*_S.rep' | cut -d_ -f2  > $filename
     69find $subsystempath/cc/ -name '*_S.rep' | cut -d_ -f2  > $filename
    7770
    7871echo "resetting runs..." >> $scriptlog 2>&1
     
    8073
    8174case $check3 in
    82    1)   echo "check3=$check3 -> everything ok -> reset is done" >> $scriptlog 2>&1 ;;
    83    *)   echo "check3=$check3 -> ERROR -> something went wrong while resetting" >> $scriptlog 2>&1 ;;
     75   1)   echo " check3=$check3 -> everything ok -> reset is done" >> $scriptlog 2>&1
     76        printprocesslog "INFO ccfiles resetted successfully"
     77        ;;
     78   0)   echo " check1=$check1 -> no connection to db -> continue..." >> $scriptlog 2>&1
     79        printprocesslog "WARN connection to DB failed"
     80        ;;
     81   *)   echo " check3=$check3 -> ERROR -> something went wrong while resetting" >> $scriptlog 2>&1
     82        printprocesslog "ERROR resettallruns.C failed for ccfiles"
     83        ;;
    8484esac
    8585
    8686
    8787echo "checking disk for cacofiles..."  >> $scriptlog 2>&1
     88printprocesslog "INFO checking cacofiles"
    8889filename=$filesondisklogpath/cacofilesondisk-$datetime.txt
    8990column=fCaCoFileAvail
    90 find $subsystemdir/caco/ -name '*.txt' | cut -d_ -f8 | grep [0-9] > $filename
     91find $subsystempath/caco/ -name '*.txt' | cut -d_ -f8 | grep [0-9] > $filename
    9192
    9293echo "resetting runs..." >> $scriptlog 2>&1
     
    9495
    9596case $check0 in
    96    1)   echo "check0=$check0 -> everything ok -> reset is done" >> $scriptlog 2>&1 ;;
    97    *)   echo "check0=$check0 -> ERROR -> something went wrong while resetting" >> $scriptlog 2>&1 ;;
     97   1)   echo " check0=$check0 -> everything ok -> reset is done" >> $scriptlog 2>&1
     98        printprocesslog "INFO cacofiles resetted successfully"
     99        ;;
     100   0)   echo " check1=$check1 -> no connection to db -> continue..." >> $scriptlog 2>&1
     101        printprocesslog "WARN connection to DB failed"
     102        ;;
     103   *)   echo " check0=$check0 -> ERROR -> something went wrong while resetting" >> $scriptlog 2>&1
     104        printprocesslog "ERROR resettallruns.C failed for cacofiles"
     105        ;;
    98106esac
    99107
     108date=`date +%F`
    100109echo "checking missing cacofiles..." >> $scriptlog 2>&1
     110printprocesslog "INFO checking missing cacofiles"
    101111check1=`root -q -b $macrospath/findcacofiles.C+\("\"$date\""\,"\"$filesondisklogpath\""\) | tee $filesondisklogpath/findcacofiles-$datetime.log | grep int | sed -e 's/(int)//'`
    102112
    103113case $check1 in
    104    1)   echo "check1=$check1 -> everything ok -> missing cacofiles are found" >> $scriptlog 2>&1 ;;
    105    *)   echo "check1=$check1 -> ERROR -> something went wrong while resetting" >> $scriptlog 2>&1 ;;
     114   1)   echo " check1=$check1 -> everything ok -> missing cacofiles are found" >> $scriptlog 2>&1
     115        printprocesslog "INFO missing cacofiles found"
     116        ;;
     117   0)   echo " check1=$check1 -> no connection to db -> continue..." >> $scriptlog 2>&1
     118        printprocesslog "WARN connection to DB failed"
     119        ;;
     120   *)   echo " check1=$check1 -> ERROR -> something went wrong while resetting" >> $scriptlog 2>&1
     121        printprocesslog "ERROR findcacofiles.C failed"
     122        ;;
    106123esac
    107124
     125printprocesslog "INFO finding missing cacofiles"
    108126missingcacoruns=(`cat $filesondisklogpath/findcacofiles-$date.txt`)
    109127for missingcacorun in ${missingcacoruns[@]}
     
    112130   echo "missing cacofile for run "$runno >> $scriptlog 2>&1
    113131   echo "-> finding cacofile" >> $scriptlog 2>&1
    114    ccfile=`find $subsystemdir/cc/ -name [2][0][0-2][0-9][0,1][0-9][0-3][0-9]_*${runno}_[P,D,C,S]_*_S.rep` 2>/dev/null
     132   ccfile=`find $subsystempath/cc/ -name [2][0][0-2][0-9][0,1][0-9][0-3][0-9]_*${runno}_[P,D,C,S]_*_S.rep` 2>/dev/null
    115133   echo " ccfile: "$ccfile  >> $scriptlog 2>&1
    116134   if [ "$ccfile" = "" ]
     
    129147         continue
    130148      else
     149         printprocesslog "INFO inserting cacofile for run $missingcacorun"
    131150         echo " inserting cacofile $file for run $missingcacorun..." >> $scriptlog 2>&1
    132151         check2=`root -q -b $macrospath/insertcacofile.C+\("\"$runno\""\,"\"$newrun\""\) | tee $filesondisklogpath/insertcacofile-$missingcacorun.log | grep int | sed -e 's/(int)//'`
    133152
    134153         case $check2 in
    135             1)   echo " check2=$check2 -> everything ok -> insert is done" >> $scriptlog 2>&1 ;;
    136             *)   echo " check2=$check2 -> ERROR -> something went wrong while inserting run "$missingcacorun >> $scriptlog 2>&1 ;;
     154            1)   echo " check2=$check2 -> everything ok -> insert is done" >> $scriptlog 2>&1
     155                 printprocesslog "INFO inserted $missingcacorun successfully"
     156                 ;;
     157            0)   echo " check1=$check1 -> no connection to db -> continue..." >> $scriptlog 2>&1
     158                 printprocesslog "WARN connection to DB failed"
     159                 ;;
     160            *)   echo " check2=$check2 -> ERROR -> something went wrong while inserting run "$missingcacorun >> $scriptlog 2>&1
     161                 printprocesslog "ERROR insertcacofile.C failed for run $missingcacorun"
     162                 ;;
    137163         esac
    138164         break
     
    142168   then
    143169      echo " no cacofile found for run "$runno >> $scriptlog 2>&1
     170      printprocesslog "WARN no cacofile found for run $runno"
    144171   else
    145172      echo " cacofile: "$cacofile >> $scriptlog 2>&1
     
    149176
    150177echo "checking disk for rawfiles..."  >> $scriptlog 2>&1
     178printprocesslog "INFO checking rawfiles"
    151179filename=$filesondisklogpath/rawfilesondisk-$datetime.txt
    152180column=fRawFileAvail
    153 find $datapath -name '*.raw' -o -name '*.gz' | cut -d_ -f2 > $filename
     181find $datapath/rawfiles -name '*.raw' -o -name '*.gz' | cut -d_ -f2 > $filename
    154182
    155183echo "resetting runs..." >> $scriptlog 2>&1
     
    157185
    158186case $check4 in
    159    1)   echo "check4=$check4 -> everything ok -> reset is done" >> $scriptlog 2>&1 ;;
    160    *)   echo "check4=$check4 -> ERROR -> something went wrong while resetting" >> $scriptlog 2>&1 ;;
     187   1)   echo " check4=$check4 -> everything ok -> reset is done" >> $scriptlog 2>&1
     188        printprocesslog "INFO rawfiles resetted successfully"
     189        ;;
     190   0)   echo " check1=$check1 -> no connection to db -> continue..." >> $scriptlog 2>&1
     191        printprocesslog "WARN connection to DB failed"
     192        ;;
     193   *)   echo " check4=$check4 -> ERROR -> something went wrong while resetting" >> $scriptlog 2>&1
     194        printprocesslog "ERROR resettallruns.C failed for rawfiles"
     195        ;;
    161196esac
    162197
    163198finish >> $scriptlog 2>&1
    164199
    165 
  • trunk/MagicSoft/Mars/datacenter/scripts/fillcallisto

    r7938 r7944  
    3636#
    3737
     38source `dirname $0`/sourcefile
     39printprocesslog "INFO starting $0"
    3840program=fillcallisto
    39 source `dirname $0`/sourcefile
     41column=fFillCallisto
    4042
    4143set -C
    4244
    43 column=fFillCallisto
    44 
    45 lockfile=$lockpath/lock-$program.txt
    46 
    47 scriptlogpath=$runlogpath/$program
    48 makedir $scriptlogpath
    49 scriptlog=$scriptlogpath/run$program-$datetime.log
    50 
     45scriptlog=$runlogpath/run$program-$datetime.log
    5146date >> $scriptlog 2>&1
    5247
    5348# check if the script is already running
     49lockfile=$lockpath/lock-$program.txt
    5450checklock  >> $scriptlog 2>&1
    5551
     
    7167for sequence in ${sequences[@]}
    7268do
     69   printprocesslog "INFO starting $program for sequence $sequence"
    7370   no=`printf %08d $sequence | cut -c 0-4`
    7471   no2=`printf %08d $sequence`
     
    8683   setstatus "start" >> $scriptlog 2>&1
    8784   echo "run fillcalib..." >> $scriptlog 2>&1
     85   printprocesslog "INFO starting fillcalib for sequence $sequence"
    8886
    8987   check1=`root -q -b $macrospath/fillcalib.C+\("\"$calibfile\""\,kFALSE\) | tee $fillcaliblog | grep int | sed -e 's/(int)//'`
    9088
    9189   case $check1 in
    92       1)   echo " check1=$check1 -> everything ok -> run fillsignal " >> $scriptlog 2>&1 ;;
     90      1)   echo " check1=$check1 -> everything ok -> run fillsignal " >> $scriptlog 2>&1
     91           printprocesslog "INFO done fillcalib successfully for sequence $sequence"
     92           ;;
    9393      0)   echo " check1=$check1 -> no connection to db -> continue..." >> $scriptlog 2>&1
     94           printprocesslog "WARN connection to DB failed"
    9495           check="no"
    9596           setstatus "stop" >> $scriptlog 2>&1
    9697           continue ;;
    9798      *)   echo " check1=$check1 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1
     99           printprocesslog "ERROR fillcalib failed for sequence $sequence"
    98100           com=$Ffillcalib
    99101           check=$check1
     
    102104   esac
    103105
     106   printprocesslog "INFO starting fillsignal for sequence $sequence"
    104107   check2=`root -q -b $macrospath/fillsignal.C+\("\"$signalfile\""\,kFALSE\) | tee $fillsignallog | grep int | sed -e 's/(int)//'`
    105108   case $check2 in
    106       1)   echo " check2=$check2 -> everything ok " >> $scriptlog 2>&1 ;;
     109      1)   echo " check2=$check2 -> everything ok " >> $scriptlog 2>&1
     110           printprocesslog "INFO done fillsignal successfully for sequence $sequence"
     111           ;;
    107112      0)   echo " check2=$check2 -> no connection to db -> continue..." >> $scriptlog 2>&1
     113           printprocesslog "WARN connection to DB failed"
    108114           check="no"
    109115           ;;
    110116      *)   echo " check2=$check2 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1
     117           printprocesslog "ERROR fillsignal failed for sequence $sequence"
    111118           com=$Ffillsignal
    112119           check=$check2
  • trunk/MagicSoft/Mars/datacenter/scripts/fillganymed

    r7938 r7944  
    3535#
    3636
     37source `dirname $0`/sourcefile
     38printprocesslog "INFO starting $0"
    3739program=fillganymed
    38 source `dirname $0`/sourcefile
     40column=fFillGanymed
    3941
    4042set -C
    4143
    42 column=fFillGanymed
    43 
    44 lockfile=$lockpath/lock-$program.txt
    45 
    46 scriptlogpath=$runlogpath/$program
    47 makedir $scriptlogpath
    48 scriptlog=$scriptlogpath/run$program-$datetime.log
    49 
     44scriptlog=$runlogpath/run$program-$datetime.log
    5045date >> $scriptlog 2>&1
    5146
    5247# check if script is already running
     48lockfile=$lockpath/lock-$program.txt
    5349checklock  >> $scriptlog 2>&1
    5450
     
    7167for dataset in ${datasets[@]}
    7268do
     69   printprocesslog "INFO starting $program for dataset $dataset"
    7370   no=`printf %08d $dataset | cut -c 0-5`
    7471   no2=`printf %08d $dataset`
     
    8683   check2=`root -q -b $macrospath/fillganymed.C+\("\"$ganymedfile\""\,kFALSE\) | tee $fillganymedlog | grep int | sed -e 's/(int)//'`
    8784   case $check2 in
    88       1)   echo " check2=$check2 -> everything ok " >> $scriptlog 2>&1 ;;
     85      1)   echo " check2=$check2 -> everything ok " >> $scriptlog 2>&1
     86           printprocesslog "INFO done fillganymed successfully for dataset $dataset"
     87           ;;
    8988      0)   echo " check2=$check2 -> no connection to db -> continue..." >> $scriptlog 2>&1
     89           printprocesslog "WARN connection to DB failed"
    9090           check="no"
    9191           ;;
    92       *)  echo " check2=$check2 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1
    93           com=$Ffillganymed
    94           check=$check2
    95           ;;
     92      *)   echo " check2=$check2 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1
     93           printprocesslog "ERROR fillganymed failed for dataset $datset"
     94           com=$Ffillganymed
     95           check=$check2
     96           ;;
    9697   esac
    9798
  • trunk/MagicSoft/Mars/datacenter/scripts/fillstar

    r7938 r7944  
    3535#
    3636
     37source `dirname $0`/sourcefile
     38printprocesslog "INFO starting $0"
    3739program=fillstar
    38 source `dirname $0`/sourcefile
     40column=fFillStar
    3941
    4042set -C
    4143
    42 column=fFillStar
    43 
    44 lockfile=$lockpath/lock-$program.txt
    45 
    46 scriptlogpath=$runlogpath/$program
    47 makedir $scriptlogpath
    48 scriptlog=$scriptlogpath/run$program-$datetime.log
    49 
     44scriptlog=$runlogpath/run$program-$datetime.log
    5045date >> $scriptlog 2>&1
    5146
    5247# check if the script is already running
     48lockfile=$lockpath/lock-$program.txt
    5349checklock  >> $scriptlog 2>&1
    5450
    5551# get todo list
    5652getdolist  >> $scriptlog 2>&1
    57 
    5853
    5954# retrieve sequences from todo file
     
    7267for sequence in ${sequences[@]}
    7368do
     69   printprocesslog "INFO starting $program for sequence $sequence"
    7470   no=`printf %08d $sequence | cut -c 0-4`
    7571   no2=`printf %08d $sequence`
     
    8783   check2=`root -q -b $macrospath/fillstar.C+\("\"$starfile\""\,kFALSE\) | tee $fillstarlog | grep \(int\) | sed -e 's/.*(int)//'`
    8884   case $check2 in
    89       1)   echo " check2=$check2 -> everything ok " >> $scriptlog 2>&1 ;;
     85      1)   echo " check2=$check2 -> everything ok " >> $scriptlog 2>&1
     86           printprocesslog "INFO done fillstar successfully for sequence $sequence"
     87           ;;
    9088      0)   echo " check2=$check2 -> no connection to db -> continue..." >> $scriptlog 2>&1
     89           printprocesslog "WARN connection to DB failed"
    9190           check="no"
    9291           ;;
    9392      *)   echo " check2=$check2 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1
     93           printprocesslog "ERROR fillstar failed for sequence $sequence"
    9494           com=$Ffillstar
    9595           check=$check2
  • trunk/MagicSoft/Mars/datacenter/scripts/insertdatasets

    r7938 r7944  
    3232#
    3333
     34source `dirname $0`/sourcefile
     35printprocesslog "INFO starting $0"
    3436program=insertdatasets
    35 source `dirname $0`/sourcefile
    3637
    3738set -C
    3839
    39 cd $mars
    40 
    41 datetime=`date +%F-%H-%M-%S`
    42 lockfile=$lockpath/lock-insertdatasets.txt
    43 
    44 scriptlogpath=$runlogpath/$program
    45 makedir $scriptlogpath
    46 
    47 scriptlog=$scriptlogpath/insertdatasets-$datetime.log
    48 
     40scriptlog=$runlogpath/$program-$datetime.log
    4941date >> $scriptlog 2>&1
    5042
    5143# check if script is already running
     44lockfile=$lockpath/lock-$program.txt
    5245checklock  >> $scriptlog 2>&1
    5346
     
    5750echo "" >> $scriptlog 2>&1
    5851
     52cd $mars
     53
    5954# extract information from dataset file and insert it into db with the macro insertdataset.C
     55printprocesslog "INFO inserting dataset information into db"
    6056for datasetfile in ${datasetfiles[@]}
    6157do
     
    7470      echo "number in filename and in file are not the same " >> $scriptlog 2>&1
    7571      echo " -> continue with next dataset" >> $scriptlog 2>&1
     72      printprocesslog "ERROR number in filename and file are not the same for dataset $no2"
    7673      continue
    7774   fi
     
    9895   insertdatasetlog=$insertdatasetpath/insertdataset-$no3.log
    9996
     97   printprocesslog "INFO inserting dataset $no2"
    10098   # insert information into db
    10199   check0=`root -q -b $macrospath/insertdataset.C+\("\"$no2\""\,"\"$source\""\,"\"$wobble\""\,"\"$comment\""\,kFALSE\) | tee $insertdatasetlog | grep int | sed -e 's/(int)//'`
    102100   case $check0 in
    103       1)   echo "check0=$check0 -> everything ok " >> $scriptlog 2>&1 ;;
    104       *)   echo "check0=$check0 -> ERROR " >> $scriptlog 2>&1 ;;
     101      1)   echo " check0=$check0 -> everything ok " >> $scriptlog 2>&1
     102           printprocesslog "INFO dataset $no2 successfully inserted"
     103           ;;
     104      0)   echo " check1=$check1 -> no connection to db -> continue..." >> $scriptlog 2>&1
     105           printprocesslog "WARN connection to DB failed"
     106           check="no"
     107           ;;
     108      *)   echo " check0=$check0 -> ERROR " >> $scriptlog 2>&1
     109           printprocesslog "ERROR $program.C failed for dataset $no2"
     110           ;;
    105111   esac
    106112done
    107113
    108 rm -v $lockfile >> $scriptlog 2>&1
     114finish >> $scriptlog 2>&1
    109115
    110 set +C
    111 
    112 date  >> $scriptlog 2>&1
    113 
  • trunk/MagicSoft/Mars/datacenter/scripts/insertsequences

    r7938 r7944  
    3333#
    3434
     35source `dirname $0`/sourcefile
     36printprocesslog "INFO starting $0"
    3537program=insertsequences
    36 source `dirname $0`/sourcefile
    3738
    3839set -C
    3940
    40 cd $mars
    41 
    42 datetime=`date +%F-%H-%M-%S`
    43 year=`date +%Y`
    44 lockfile=$lockpath/lock-insertsequences.txt
    45 
    46 scriptlogpath=$runlogpath/$program
    47 makedir $scriptlogpath
    48 
    49 scriptlog=$scriptlogpath/insertsequences-$datetime.log
    50 
     41scriptlog=$runlogpath/$program-$datetime.log
    5142date >> $scriptlog 2>&1
    5243
    5344# check if script is already running
     45lockfile=$lockpath/lock-$program.txt
    5446checklock  >> $scriptlog 2>&1
    5547
     
    6153echo "" >> $scriptlog 2>&1
    6254
     55cd $mars
     56
    6357# process sequencefiles: insert information into the database
    6458for sequencefile in ${sequencefiles[@]}
    6559do
     60   printprocesslog "INFO inserting sequence from file $sequencefile"
    6661   echo "file: "$sequencefile >> $scriptlog 2>&1
    6762   no=`echo $sequencefile | cut -c 31-38`
    68    no=`echo $no | cut -c 1-4`
    69    insertsequencepath=$logpath/insertsequence/$no
     63   no2=`echo $no | cut -c 1-4`
     64   insertsequencepath=$logpath/$program/$no2
    7065   makedir $insertsequencepath >> $scriptlog 2>&1
    71    insertsequencelog=$insertsequencepath/insertsequence-$no.log
     66   insertsequencelog=$insertsequencepath/$program-$no.log
    7267
    7368   check0=`root -q -b $macrospath/insertsequence.C+\("\"$sequencefile\""\,kFALSE\) | tee $insertsequencelog | grep int | sed -e 's/(int)//'`
    7469   case $check0 in
    75       1)   echo "check0=$check0 -> everything ok " >> $scriptlog 2>&1 ;;
    76       *)   echo "check0=$check0 -> ERROR " >> $scriptlog 2>&1 ;;
     70      1)   echo "check0=$check0 -> everything ok " >> $scriptlog 2>&1
     71           printprocesslog "INFO sequence $no2 successfully inserted"
     72           ;;
     73      0)   echo " check1=$check1 -> no connection to db -> continue..." >> $scriptlog 2>&1
     74           printprocesslog "WARN connection to DB failed"
     75           check="no"
     76           ;;
     77      *)   echo "check0=$check0 -> ERROR " >> $scriptlog 2>&1
     78           printprocesslog "ERROR $program.C failed for sequence $no2"
     79           ;;
    7780   esac
    7881done
    7982
    80 rm -v $lockpath/lock-insertsequences.txt >> $scriptlog 2>&1
     83finish >> $scriptlog 2>&1
    8184
    82 set +C
    83 
    84 date  >> $scriptlog 2>&1
    85 
  • trunk/MagicSoft/Mars/datacenter/scripts/jobmanager

    r7936 r7944  
    3131
    3232source `dirname $0`/sourcefile
    33 user=`whoami`
     33printprocesslog "INFO starting $0"
    3434
    3535set -C
     
    4242
    4343prev=$max
     44user=`whoami`
    4445notcount=0
    4546while (( $notcount < 100 ))
     
    117118         nail -s 'condor problem'  $erradrs < $jmerrorlog
    118119         echo "condor is not working -> sleeping $errorsleeptime" >> $jmscriptlog 2>&1
     120         printprocesslog "ERROR submitting ${scripts[$i]} to condor failed"
    119121         sleep $errorsleeptime
    120122      fi
  • trunk/MagicSoft/Mars/datacenter/scripts/linkmc

    r7938 r7944  
    4242#
    4343
     44source `dirname $0`/sourcefile
     45printprocesslog "INFO starting $0"
    4446program=linkmc
    45 source `dirname $0`/sourcefile
    4647
    4748set -C
    4849
    49 scriptlogpath=$runlogpath/$program
    50 makedir $scriptlogpath
    51 scriptlog=$scriptlogpath/linkmc`date +%F`.log
    52 
     50scriptlog=$runlogpath/$progam-`date +%F`.log
    5351date >> $scriptlog 2>&1
    5452
    5553# check if script is already running
    56 lockfile=$lockpath/lock-mclinks.txt
     54lockfile=$lockpath/lock-$program.txt
    5755checklock  >> $scriptlog 2>&1
    5856
     
    6765then
    6866   echo "file $next not found -> no start-runno -> exit" >> $scriptlog 2>&1
    69    rm -v $lockfile >> $scriptlog 2>&1
    70    exit
     67   printprocesslog "ERROR file $next (last runno) not found"
     68   finish >> $scriptlog 2>&1
    7169fi
    7270
     
    116114camfiles=`find $mccampath -type f | grep -v Cal_and_Ped`
    117115
     116printprocesslog "INFO linking new camerafiles starting with runno $runno"
    118117for camfile in ${camfiles[@]}
    119118do
     
    123122      continue
    124123   fi
     124   printprocesslog "INFO linking $file"
    125125   file=`basename $camfile` #filename
    126126   no=`printf %08d $runno | cut -c 0-5` #first 5 digits of a 8digit runno -> for path
     
    177177done
    178178
     179printprocesslog "INFO linking cal and ped files"
    179180echo "linking cal and ped file" >> $scriptlog 2>&1
    180181#get files
     
    188189then
    189190   "too many files in the directory $mccampath/Cal_and_Ped -> exit" >> $scriptlog 2>&1
    190    rm -v $lockfile >> $scriptlog 2>&1
    191    exit
     191   printprocesslog "ERROR too many ped and cal files found in $mccampath/Cal_and_Ped"
     192   finish >> $scriptlog 2>&1
    192193fi
    193194
     
    225226done
    226227
    227 rm -v $lockfile >> $scriptlog 2>&1
    228 
    229 set +C
    230 
    231 date  >> $scriptlog 2>&1
    232 
     228finish >> $scriptlog 2>&1
     229
  • trunk/MagicSoft/Mars/datacenter/scripts/makecallistolinks

    r7938 r7944  
    3333#
    3434
     35source `dirname $0`/sourcefile
     36printprocesslog "INFO starting $0"
    3537program=makecallistolinks
    36 source `dirname $0`/sourcefile
     38column=fCallisto
    3739
    3840set -C
    3941
    40 callistorcseq=callisto.rc
    41 callistorcnew=callisto_Dec04Jan05.rc
    42 
    43 scriptlogpath=$runlogpath/$program
    44 makedir $scriptlogpath
    45 scriptlog=$scriptlogpath/$program`date +%F`.log
    46 
     42scriptlog=$runlogpath/$program`date +%F`.log
    4743date >> $scriptlog 2>&1
    4844
     
    5147checklock  >> $scriptlog 2>&1
    5248
     49callistorcseq=callisto.rc
     50callistorcnew=callisto_Dec04Jan05.rc
    5351# reason why calibration with standard callisto.rc fails
    5452reason1="Pulse is too much to the right, cannot go beyond logain limits!"
     
    6058then
    6159   echo "nothing to do -> exit"  >> $scriptlog 2>&1
    62    rm -v $lockfile >> $scriptlog 2>&1
     60   finish >> $scriptlog 2>&1
    6361fi
    64 
    65 column=fCallisto
    66 table=SequenceProcessStatus
    6762
    6863cd $mars
    6964
    7065# make links for callisto.rc for which the callisto.log contains reason
     66printprocesslog "INFO linking callisto.rc files"
    7167for file in $files
    7268do
     
    8076      if ! ls -l $callistorc | grep $callistorcnew >> $scriptlog 2>&1
    8177      then
     78         printprocesslog "INFO linking $callistorcnew to $callistorc for sequ $sequ"
    8279         # resetting the calibration
    8380         echo "resetting the callisto for sequence $sequ" >> $scriptlog 2>&1
     
    9087         case $check1 in
    9188            1)   echo " check1=$check1 -> everything ok, callisto has been reset " >> $scriptlog 2>&1
     89                 printprocesslog "INFO resetted calibration successfully for sequence $sequ"
     90                 ;;
     91            0)   echo " check1=$check1 -> no connection to db -> continue..." >> $scriptlog 2>&1
     92                 printprocesslog "WARN connection to DB failed"
     93                 check="no"
    9294                 ;;
    9395            *)   echo " check1=$check1 -> ERROR -> step could not be resetted -> continue " >> $scriptlog 2>&1
    94                  continue ;;
     96                 printprocesslog "ERROR resetcolumn.C failed for fCallisto for sequ $sequ"
     97                 continue
     98                 ;;
    9599         esac
    96100         #linking callisto.rc
     
    100104done
    101105
    102 rm -v $lockfile >> $scriptlog 2>&1
     106finish >> $scriptlog 2>&1
    103107
    104 set +C
    105 
    106 date  >> $scriptlog 2>&1
    107 
  • trunk/MagicSoft/Mars/datacenter/scripts/mcsequences

    r7938 r7944  
    3434#
    3535
     36source `dirname $0`/sourcefile
     37printprocesslog "INFO starting $0"
    3638program=mcsequences
    37 source `dirname $0`/sourcefile
    3839
    3940set -C
    4041
    41 scriptlogpath=$runlogpath/$program
    42 makedir $scriptlogpath
    43 scriptlog=$scriptlogpath/$program`date +%F`.log
    44 
     42scriptlog=$runlogpath/$program`date +%F`.log
    4543date >> $scriptlog 2>&1
    4644
     
    4947checklock  >> $scriptlog 2>&1
    5048
    51 
    5249mcpath=/montecarlo/rawfiles
    5350mcsequpath=/montecarlo/sequences
    5451
    5552# find montecarlo directories, build one sequence per directory and write sequence file
     53printprocesslog "INFO building one sequence per mcdirectory"
    5654dirs=`find $mcpath -type d`
    5755for dir in ${dirs[@]}
     
    8381   sequfile=$sequpath/sequence$no2.txt
    8482   echo "writing sequfile "$sequfile >> $scriptlog 2>&1
     83   printprocesslog "INFO writing sequencefile $sequfile"
    8584   
    8685   echo "Sequence:        $firstrun" > $sequfile
     
    9392done
    9493
     94finish >> $scriptlog 2>&1
    9595
    96 rm -v $lockfile >> $scriptlog 2>&1
    97 
    98 set +C
    99 
    100 date  >> $scriptlog 2>&1
    101 
  • trunk/MagicSoft/Mars/datacenter/scripts/movingrawfiles

    r7938 r7944  
    3131
    3232source `dirname $0`/sourcefile
     33printprocesslog "INFO starting $0"
     34program=movingrawfiles
    3335
    3436set -C
     37umask 0002
    3538
    36 program=movingrawfiles
    37 
    38 lockfile=$lockpath/lock-$program.txt
    39 
    40 scriptlogpath=$runlogpath/$program
    41 makedir $scriptlogpath
    42 scriptlog=$scriptlogpath/$program-$datetime.log
    43 
     39scriptlog=$runlogpath/$program-$datetime.log
    4440date >> $scriptlog 2>&1
    4541
    4642# check if script is already running
     43lockfile=$lockpath/lock-$program.txt
    4744checklock  >> $scriptlog 2>&1
    48 
    49 
    50 umask 0002
    5145
    5246# change permission for files
     
    5448# output for chmod with -v or -c (only changes)
    5549
     50printprocesslog "INFO moving directories from fromlapalma to fromtape"
    5651#find directories, which have to be copied
    5752dirs=`ls /magic/datacenter/fromlapalma/RAWchk/*/*.finished | sed -e 's/RAWchk/RAW/g' | cut -d/ -f1-6`
     
    7469fi
    7570
     71printprocesslog "INFO moving moving rawfiles to $datapath/rawfiles"
    7672for rawfile in $rawfiles
    7773do
     
    8783rmdir -v /magic/datacenter/fromtape/rawdata/* >> $scriptlog 2>&1
    8884
     85printprocesslog "INFO launching filesondisk"
    8986echo "launching filesondisk" >> $scriptlog 2>&1
    9087$scriptspath/filesondisk&
  • trunk/MagicSoft/Mars/datacenter/scripts/processmcsequences

    r7938 r7944  
    3232#
    3333
     34source `dirname $0`/sourcefile
     35printprocesslog "INFO starting $0"
    3436program=processmcsequences
    35 source `dirname $0`/sourcefile
    3637
    3738set -C
    3839
    39 scriptlogpath=$runlogpath/$program
    40 makedir $scriptlogpath
    41 scriptlog=$scriptlogpath/$program`date +%F-%H-%M-%S`.log
    42 
     40scriptlog=$runlogpath/$program`date +%F-%H-%M-%S`.log
    4341date >> $scriptlog 2>&1
    4442
     
    5654
    5755# find montecarlo sequence files
     56printprocesslog "INFO processing mc sequences"
    5857sequfiles=`find $mcsequpath -type f`
    5958for sequfile in ${sequfiles[@]}
     
    9594   # if calibration worked -> run star for sequence
    9695   case $check1 in
    97       0)   echo "check1=$check1 -> everything ok..." >> $scriptlog 2>&1
     96      0)   echo " check1=$check1 -> everything ok..." >> $scriptlog 2>&1
     97           printprocesslog "INFO calibrated mc sequende $sequno successfully"
    9898           touch $caloutpath/.done
    9999           rm $caloutpath/.doing
     
    105105           
    106106           case $check2 in
    107               0)   echo "check2=$check2 -> everything ok..." >> $scriptlog 2>&1
     107              0)   echo " check2=$check2 -> everything ok..." >> $scriptlog 2>&1
     108                   printprocesslog "INFO run star successfully for mc sequende $sequno"
    108109                   touch $imgoutpath/.done
    109110                   ;;
    110               *)   echo "check2=$check2 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1
     111              *)   echo " check2=$check2 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1
     112                   printprocesslog "ERROR star failed for mc sequende $sequno"
    111113                   ;;
    112114           esac
    113115           ;;
    114       *)   echo "check1=$check1 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1;;
     116      *)   echo " check1=$check1 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1
     117           printprocesslog "ERROR callisto failed for mc sequende $sequno"
     118           ;;
    115119   esac
    116120done
    117121
    118 rm -v $lockfile >> $scriptlog 2>&1
     122finish >> $scriptlog 2>&1
    119123
    120 set +C
    121 
    122 date  >> $scriptlog 2>&1
    123 
  • trunk/MagicSoft/Mars/datacenter/scripts/rmlocks

    r7902 r7944  
    3838
    3939source `dirname $0`/sourcefile
     40printprocesslog "INFO starting $0"
    4041
    4142files=`ls $lockpath/*`
     
    4950   if [ $compdate -gt $filedate ]
    5051   then
     52      printprocesslog "INFO removing file $file"
    5153      rm -v $file
    5254      echo "date:  "$filedate
  • trunk/MagicSoft/Mars/datacenter/scripts/runcallisto

    r7938 r7944  
    3737#
    3838
     39source `dirname $0`/sourcefile
     40printprocesslog "INFO starting $0"
    3941program=callisto
    40 source `dirname $0`/sourcefile
     42column=fCallisto
    4143
    4244set -C
    4345
    44 # define callisto.rc files
    45 callistorcnew=$setuppath/$program/callisto.rc
    46 callistorcmarapr05=$setuppath/$program/callisto_MarApr05.rc
    47 
    48 column=fCallisto
    49 #pno=500 # number of processes, i.e. number of todo-files
    50 
    51 scriptlogpath=$runlogpath/$program
    52 makedir $scriptlogpath
    53 scriptlog=$scriptlogpath/run$program-$datetime.log
    54 
     46scriptlog=$runlogpath/run$program-$datetime.log
    5547date >> $scriptlog 2>&1
    5648
     
    6759# run calibration for sequence
    6860echo "run $program for sequence $sequence..." >> $scriptlog 2>&1
     61printprocesslog "INFO starting $program for sequence $sequence"
    6962no=`printf %08d $sequence | cut -c 0-4`
    7063no2=`printf %08d $sequence`
     
    7366outpath="$datapath/$program/$no/$no2"
    7467makedir $outpath >> $scriptlog 2>&1
    75 
    7668sequfile="$sequpath/$no/sequence$no2.txt"
    7769
     70# define callisto.rc files
     71callistorcnew=$setuppath/$program/callisto.rc
     72callistorcmarapr05=$setuppath/$program/callisto_MarApr05.rc
    7873# find callisto.rc file
    7974if [ -e $outpath/callisto.rc ]
     
    9994case $check1 in
    10095   0)   echo " check1=$check1 -> everything ok -> doing update..." >> $scriptlog 2>&1
     96        printprocesslog "INFO $program finished successfully for sequence $sequence"
    10197        # running merpp update if calibration worked
    10298        # finding files, which have to be updated
     
    113109        makedir $merpplogpath >> $scriptlog 2>&1
    114110       
     111        printprocesslog "INFO doing merppupdate for sequence $sequence"
    115112        # updated calibrated data files with the information from the cc and caco files
    116113        for calfile in ${calfiles[@]}
     
    127124           then
    128125              echo "no ccfile found for run "$runno >> $scriptlog 2>&1
     126              printprocesslog "ERROR  no ccfile found for $calfile"
    129127              com=$Fnoccfile
    130128              comadd=$runno
     
    163161           check2=$?
    164162           case $check2 in
    165                    0)   echo " check2=$check2 -> everything ok, merppccupdate worked -> continue" >> $scriptlog 2>&1;;
    166              *)   echo " check2=$check2 -> ERROR -> merppccupdate failed" >> $scriptlog 2>&1
     163                   0)   echo " check2=$check2 -> everything ok, merppccupdate worked -> continue" >> $scriptlog 2>&1
     164                        printprocesslog "INFO merppupdated $calfile sucessfully with $ccfile"
     165                        ;;
     166                   *)   echo " check2=$check2 -> ERROR -> merppccupdate failed" >> $scriptlog 2>&1
     167                        printprocesslog "ERROR merppccupdate failed for $calfile"
    167168                        com=$Fmerppcc
    168169                        comadd=$runno
     
    173174           check3=$?
    174175           case $check3 in
    175                    0)   echo " check3=$check3 -> everything ok, merppcacoupdate worked -> continue" >> $scriptlog 2>&1;;
    176              *)   echo " check3=$check3 -> ERROR -> merppcacoupdate failed" >> $scriptlog 2>&1
     176                   0)   echo " check3=$check3 -> everything ok, merppcacoupdate worked -> continue" >> $scriptlog 2>&1
     177                        printprocesslog "INFO merppupdated $calfile sucessfully with $cacofile"
     178                        ;;
     179                   *)   echo " check3=$check3 -> ERROR -> merppcacoupdate failed" >> $scriptlog 2>&1
     180                        printprocesslog "ERROR merppcacoupdate failed for $calfile"
    177181                        com=$Fmerppcaco
    178182                        comadd=$runno
     
    183187          ;;
    184188   *)   echo " check1=$check1 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1
     189        printprocesslog "ERROR $program failed for sequence $sequence"
    185190        com=$Fcallisto
    186191        check=$check1
  • trunk/MagicSoft/Mars/datacenter/scripts/runganymed

    r7938 r7944  
    3737#
    3838
     39source `dirname $0`/sourcefile
     40printprocesslog "INFO starting $0"
    3941program=ganymed
    40 source `dirname $0`/sourcefile
     42column=fGanymed
    4143
    4244set -C
    4345
    44 column=fGanymed
    45 
    46 scriptlogpath=$runlogpath/$program
    47 makedir $scriptlogpath
    48 scriptlog=$scriptlogpath/run$program-$datetime.log
    49 
     46scriptlog=$runlogpath/run$program-$datetime.log
    5047date >> $scriptlog 2>&1
    5148
     
    6158
    6259echo "run $program for dataset $dataset..." >> $scriptlog 2>&1
     60printprocesslog "INFO starting $program for dataset $dataset"
    6361no=`printf %08d $dataset | cut -c 0-5`
    6462no2=`printf %08d $dataset`
     
    8684
    8785case $check1 in
    88    0)   echo " check1=$check1 -> everything ok " >> $scriptlog 2>&1 ;;
     86   0)   echo " check1=$check1 -> everything ok " >> $scriptlog 2>&1
     87        printprocesslog "INFO $program finished successfully for dataset $dataset"
     88        ;;
    8989   *)   echo " check1=$check1 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1
     90        printprocesslog "ERROR $program failed for dataset $dataset"
    9091        com=$Fganymed
    9192        check=$check1
  • trunk/MagicSoft/Mars/datacenter/scripts/runstar

    r7938 r7944  
    3737#
    3838
     39source `dirname $0`/sourcefile
     40printprocesslog "INFO starting $0"
    3941program=star
    40 source `dirname $0`/sourcefile
     42column=fStar
    4143
    4244set -C
    4345
    44 column=fStar
    45 
    46 scriptlogpath=$runlogpath/$program
    47 makedir $scriptlogpath
    48 scriptlog=$scriptlogpath/run$program-$datetime.log
    49 
     46scriptlog=$runlogpath/run$program-$datetime.log
    5047date >> $scriptlog 2>&1
    5148
     
    6158
    6259echo "run $program for sequence $sequence..." >> $scriptlog 2>&1
     60printprocesslog "INFO starting $program for sequence $sequence"
    6361no=`printf %08d $sequence | cut -c 0-4`
    6462no2=`printf %08d $sequence`
     
    7775
    7876case $check1 in
    79    0)   echo " check1=$check1 -> everything ok " >> $scriptlog 2>&1;;
     77   0)   echo " check1=$check1 -> everything ok " >> $scriptlog 2>&1
     78        printprocesslog "INFO $program finished successfully for sequence $sequence"
     79        ;;
    8080   *)   echo " check1=$check1 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1
     81        printprocesslog "ERROR $program failed for sequence $sequence"
    8182        com=$Fstar
    8283        check=$check1
  • trunk/MagicSoft/Mars/datacenter/scripts/scriptlauncher

    r7936 r7944  
    1818#
    1919#
    20 #   Author(s): Daniela Dorner  05/2005 <mailto:dorner@astro.uni-wuerzburg.de>
     20#   Author(s): Daniela Dorner  08/2006 <mailto:dorner@astro.uni-wuerzburg.de>
    2121#
    2222#   Copyright: MAGIC Software Development, 2000-2006
     
    2929
    3030source `dirname $0`/sourcefile
     31printprocesslog "INFO starting $0 $@"
    3132
    3233makedir $listpath
    3334makedir $lockpath
    3435
    35 sllogpath=$logpath/scriptlauncher/`date +%Y/%m`
    36 makedir $sllogpath
    37 errorlog=$sllogpath/error`date +%F`.log
    38 scriptlog=$sllogpath/scriptlauncher`date +%F`.log
     36errorlog=$runlogpath/scriptlauncher-error`date +%F`.log
     37scriptlog=$runlogpath/scriptlauncher`date +%F`.log
    3938
    4039echo `date`": starting $0 $@"  >> $scriptlog 2>&1
     
    5352   fi
    5453   echo " launching $i..." >> $scriptlog 2>&1
    55    pid=`/usr/local/bin/condor_submit -a path=$path -a prog=$i -a date=$date2 -a dir=$condordir $path/run.condor | grep cluster | cut -dr -f2`  2>$errorlog
     54   if ! pid=`/usr/local/bin/condor_submit -a path=$path -a prog=$i -a date=$date2 -a dir=$condordir $path/run.condor | grep cluster | cut -dr -f2`  2>$errorlog
     55   then
     56      echo "condor is not working " >> $errorlog 2>&1
     57      printprocesslog "ERROR submitting $i to condor failed"
     58   fi
    5659   if ! echo $@ | grep "allatthesametime" >/dev/null 2>$errorlog
    5760   then
     
    6366echo "" >> $scriptlog 2>&1
    6467
     68printprocesslog "INFO finished $0 $@"
     69
  • trunk/MagicSoft/Mars/datacenter/scripts/setup

    r7938 r7944  
    3434
    3535logpath=/magic/datacenter/autologs
    36 runlogpath=/magic/datacenter/autologs/run/`date +%Y/%m/%d`
    3736lockpath=/magic/datacenter/locks
    3837listpath=/magic/datacenter/lists
     
    4342sequpath=/magic/sequences
    4443datasetpath=/magic/datasets
     44
    4545
    4646webpath=/www/htdocs/datacenter
     
    5656errorsleeptime=180 #180
    5757max=16 #maximum number of processes
    58 #log files (can't be defined in script itself, as script can run longer
    59 #than one day
    60 jmlogpath=$logpath/jobmanager/`date +%Y/%m`
    61 jmerrorlog=$jmlogpath/error`date +%F`.log
    62 jmscriptlog=$jmlogpath/jobmanager`date +%F`.log
    6358
    6459scripts=( "runcallisto" "runstar" "runganymed" "dodatacheck" )
     
    6661
    6762#hour:            0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
    68 pnototal=(       16 16 16 16 16 16 16 12 12 12 10 10 10 12 12 12 12 12 12 14 16 16 16 16 )
     63pnototal=(       16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 )
    6964pnototalwe=(     16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 )
    7065
    71 pnocallisto=(     8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8 )
    72 pnostar=(         8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8 )
    73 pnoganymed=(      3  3  3  3  3  3  3  2  2  2  1  1  2  2  1  1  1  1  1  2  2  3  3  3 )
     66pnocallisto=(    12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 )
     67pnostar=(         5  5  5  5  5  5  5  5  5  5  5  5  5  5  5  5  5  5  5  5  5  5  5  5 )
     68pnoganymed=(      2  2  2  2  2  2  2  2  2  2  2  2  2  2  2  2  2  2  2  2  2  2  2  2 )
    7469pnodatacheck=(   16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 )
    7570
    76 pnocallistowe=(  10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 )
    77 pnostarwe=(      10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 )
    78 pnoganymedwe=(    3  3  3  3  3  3  3  3  3  3  3  3  3  3  3  3  3  3  3  3  3  3  3  3 )
     71pnocallistowe=(  12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 )
     72pnostarwe=(       5  5  5  5  5  5  5  5  5  5  5  5  5  5  5  5  5  5  5  5  5  5  5  5 )
     73pnoganymedwe=(    2  2  2  2  2  2  2  2  2  2  2  2  2  2  2  2  2  2  2  2  2  2  2  2 )
    7974pnodatacheckwe=( 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 )
    8075
  • trunk/MagicSoft/Mars/datacenter/scripts/sourcefile

    r7936 r7944  
    3939webpath=/www/htdocs/datacenter
    4040
    41 processlogpath=$logpath/run/`date +%Y/%m/%d`
    42 processlog=$processlogpath/process`date +%F`.log
     41runlogpath=$logpath/run/`date +%Y/%m/%d`
     42makedir $runlogpath
     43processlog=$runlogpath/process`date +%F`.log
    4344
    4445datetime=`date +%F-%H-%M-%S`
     
    7677# setup for jobmanager
    7778#
     79#log files (can't be defined in script itself, as script can run longer
     80#than one day
     81jmerrorlog=$runlogpath/jobmanager-error`date +%F`.log
     82jmscriptlog=$runlogpath/jobmanager`date +%F`.log
    7883steps=$mars/steps.rc
    7984# resetting values
     
    120125   rm -v $lockfile
    121126   date
     127   printprocesslog "INFO finished $program"
    122128   exit
    123129}
     
    234240               ;;
    235241          *)   echo "error -> exit"
    236                exit
     242               printprocesslog "ERROR function evalstatus got wrong variable"
     243               finish
    237244               ;;
    238245   esac
     
    304311   if ! process=`mysql -s -u $us --password=$pw --host=hercules $db -e " $query "`
    305312   then
    306       echo "ERROR could not query process from db -> exit"
     313      echo "ERROR could not query processes from db -> exit"
     314      printprocesslog "ERROR could not query processes from db (program: $program, function getdolist)"
    307315      finish
    308316   fi
     
    318326      then
    319327         echo "$todofile exists already"
     328         printprocesslog "WARN $todofile exists already (program: $program, function getdolist)"
    320329         finish
    321330      fi
     
    349358   then
    350359      echo "ERROR could not query process from db -> exit"
     360      printprocesslog "ERROR could not query process from db (program: $program, function gettodo)"
    351361      finish
    352362   fi
     
    384394   then
    385395      echo "ERROR could not query number of todo proceses from db -> continue"
     396      printprocesslog "ERROR could not query number of processes from db (program: $program, function getstatus)"
    386397      cont
    387398   fi
     
    400411   then
    401412      echo "YOU CAN'T RESET $column for $var2!!!"
     413      printprocesslog "ERROR you can't reset $column for $var2"
    402414      finish
    403415   fi
     
    416428   then
    417429      echo "ERROR could not insert status into db -> exit"
    418       finish
    419    fi
    420 
    421 }
     430      printprocesslog "ERROR could not set status in db (program: $program, function setstatus)"
     431      finish
     432   fi
     433
     434}
  • trunk/MagicSoft/Mars/datacenter/scripts/webupdate-callisto

    r7915 r7944  
    2929
    3030source `dirname $0`/sourcefile
     31printprocesslog "INFO starting $0"
    3132
    32 date
     33scriptlog=$runlogpath/webupdate-callisto-$datetime.log
     34date >> $scriptlog 2>&1
    3335
    34 echo "do plots for all root-files (callisto) ..."
     36echo "do plots for all root-files (callisto) ..." >> $scriptlog 2>&1
    3537$scriptspath/dowebplots -p callisto
    3638
     39echo "do rsync for callisto files" >> $scriptlog 2>&1
     40rsync -av --delete --exclude=*/*/*_E[.]root --exclude=*/*/callisto.rc $datapath/callisto/ $webpath/callisto >> $scriptlog 2>&1
    3741
    38 echo "do rsync for callisto files"
    39 rsync -av --delete --exclude=*/*/*_E[.]root --exclude=*/*/callisto.rc $datapath/callisto/ $webpath/callisto
     42echo "do rsync for subsystem files" >> $scriptlog 2>&1
     43rsync -av --delete /magic/subsystemdata/ $webpath/subsystemdata >> $scriptlog 2>&1
    4044
    41 #echo "do rsync for subsystem files"
    42 rsync -av --delete /magic/subsystemdata/ $webpath/subsystemdata
     45echo "do rsync for sequence files" >> $scriptlog 2>&1
     46rsync -av --delete /magic/sequences/ $webpath/sequences >> $scriptlog 2>&1
    4347
    44 echo "do rsync for sequence files"
    45 rsync -av --delete /magic/sequences/ $webpath/sequences
     48date >> $scriptlog 2>&1
    4649
    47 date
     50printprocesslog "INFO $0 finished"
    4851
    49 
  • trunk/MagicSoft/Mars/datacenter/scripts/webupdate-ganymed

    r7916 r7944  
    2929
    3030source `dirname $0`/sourcefile
     31printprocesslog "INFO starting $0"
    3132
    32 date
     33scriptlog=$runlogpath/webupdate-ganymed-$datetime.log
     34date >> $scriptlog 2>&1
    3335
    34 echo "do plots for all root-files (ganymed) ..."
     36echo "do plots for all root-files (ganymed) ..." >> $scriptlog 2>&1
    3537$scriptspath/dowebplots -p ganymed
    3638
    37 echo "do rsync for ganymed files"
    38 rsync -av --delete $datapath/ganymed/ $webpath/ganymed
     39echo "do rsync for ganymed files" >> $scriptlog 2>&1
     40rsync -av --delete $datapath/ganymed/ $webpath/ganymed >> $scriptlog 2>&1
    3941
    40 echo "do rsync for dataset files"
    41 rsync -av --delete /magic/datasets/ $webpath/datasets
     42echo "do rsync for dataset files" >> $scriptlog 2>&1
     43rsync -av --delete /magic/datasets/ $webpath/datasets >> $scriptlog 2>&1
    4244
    43 date
     45date >> $scriptlog 2>&1
    4446
     47printprocesslog "INFO $0 finished"
    4548
  • trunk/MagicSoft/Mars/datacenter/scripts/webupdate-sinope

    r7916 r7944  
    2828
    2929source `dirname $0`/sourcefile
     30printprocesslog "INFO starting $0"
    3031
    31 date
     32scriptlog=$runlogpath/webupdate-sinope-$datetime.log
     33date >> $scriptlog 2>&1
    3234
    33 echo "do plots for all root-files (sinope) ..."
    34 $scriptspath/dowebplots -p sinope
     35echo "do plots for all root-files (sinope) ..." >> $scriptlog 2>&1
     36$scriptspath/dowebplots -p sinope >> $scriptlog 2>&1
    3537
    36 echo "do rsync for sinope files"
    37 rsync -av --delete $datapath/sinope/ $webpath/sinope
     38echo "do rsync for sinope files" >> $scriptlog 2>&1
     39rsync -av --delete $datapath/sinope/ $webpath/sinope >> $scriptlog 2>&1
    3840
    39 date
     41date >> $scriptlog 2>&1
    4042
     43printprocesslog "INFO $0 finished"
    4144
  • trunk/MagicSoft/Mars/datacenter/scripts/webupdate-star

    r7916 r7944  
    2929
    3030source `dirname $0`/sourcefile
     31printprocesslog "INFO starting $0"
    3132
    32 date
     33scriptlog=$runlogpath/webupdate-star-$datetime.log
     34date >> $scriptlog 2>&1
    3335
    34 echo "do plots for all root-files (star) ... "
     36echo "do plots for all root-files (star) ... " >> $scriptlog 2>&1
    3537$scriptspath/dowebplots -p star
    3638
    37 echo "do rsync for star files"
    38 rsync -av --delete --exclude=*/*/*_E[.]root $datapath/star/ $webpath/star
     39echo "do rsync for star files" >> $scriptlog 2>&1
     40rsync -av --delete --exclude=*/*/*_E[.]root $datapath/star/ $webpath/star >> $scriptlog 2>&1
    3941
    40 echo "do rsync for star files from la palma"
    41 rsync -av --delete --exclude=*/*_E[.]root --exclude=*/Time*.dat /scratch/lapalma/star/ $webpath/star_lapalma
     42echo "do rsync for star files from la palma" >> $scriptlog 2>&1
     43rsync -av --delete --exclude=*/*_E[.]root --exclude=*/Time*.dat /scratch/lapalma/star/ $webpath/star_lapalma >> $scriptlog 2>&1
    4244
    43 echo "do rsync for sequence files"
    44 rsync -av --delete /magic/sequences/ $webpath/sequences
     45echo "do rsync for sequence files" >> $scriptlog 2>&1
     46rsync -av --delete /magic/sequences/ $webpath/sequences >> $scriptlog 2>&1
    4547
    46 date
     48date >> $scriptlog 2>&1
    4749
     50printprocesslog "INFO $0 finished"
    4851
  • trunk/MagicSoft/Mars/datacenter/scripts/writesequencefiles

    r7938 r7944  
    3535#
    3636
     37source `dirname $0`/sourcefile
     38printprocesslog "INFO starting $0"
    3739program=writesequencefile
    38 source `dirname $0`/sourcefile
     40column=fSequenceFileWritten
    3941
    4042set -C
    4143
    42 column=fSequenceFileWritten
    43 
    44 lockfile=$lockpath/lock-$program.txt
    45 
    46 scriptlogpath=$runlogpath/$program
    47 makedir $scriptlogpath
    48 scriptlog=$scriptlogpath/run$program-$datetime.log
    49 
     44scriptlog=$runlogpath/$program-$datetime.log
    5045date >> $scriptlog 2>&1
    5146
    5247# check if script is already running
     48lockfile=$lockpath/lock-$program.txt
    5349checklock  >> $scriptlog 2>&1
    5450
     
    7167for sequence in ${sequences[@]}
    7268do
     69   printprocesslog "INFO write sequence files for sequence $sequence"
    7370   no=`printf %08d $sequence | cut -c 0-4`
    7471   no2=`printf %08d $sequence`
     
    8784   check2=`root -q -b $macrospath/writesequencefile.C+\($sequence\,"\"$sequpath\""\) | tee $writesequencefilelog | grep int | sed -e 's/(int)//'`
    8885   case $check2 in
    89       1)   echo " check2=$check2 -> everything ok " >> $scriptlog 2>&1 ;;
     86      1)   echo " check2=$check2 -> everything ok " >> $scriptlog 2>&1
     87           printprocesslog "INFO sequence file successfully written for sequence $sequence"
     88           ;;
    9089      0)   echo " check2=$check2 -> no connection to db -> continue..." >> $scriptlog 2>&1
     90           printprocesslog "WARN connection to DB failed"
    9191           check="no"
    9292           ;;
    9393      *)   echo " check2=$check2 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1
     94           printprocesslog "ERROR $program.C failed for sequence $sequence"
    9495           com=$Fwritesequfile
    9596           check=$check2
Note: See TracChangeset for help on using the changeset viewer.