Ignore:
Timestamp:
08/12/08 10:20:17 (16 years ago)
Author:
snruegam
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/datacenter/scripts
Files:
4 edited

Legend:

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

    r8886 r9114  
    6262
    6363date | tee ${checkpath}/tape_${id}.md5.lapalma | tee ${checkpath}/tape_${id}.md5.wue
     64muxslog=`grep muxdata/20[01][0-9].*/20[01][0-9].*.raw $file | wc -l`
    6465
    6566# read the tapecont file line by line
     
    6768do
    6869   muxchk=`echo $line | cut -d/ -f1`
    69    type=`echo $line | cut -d_ -f7 | cut -c0-5`
     70   type=`echo $line | sed -e 's/.*20[01][0-9]\{5\}_.*\(.raw\)/\1/' | cut -c 0-4`
    7071   # only check muxdata rawfiles, not cc-, caco- or drivelog-files
    71    if [ "$muxchk" = "muxdata" ] && [ "$type" = "E.raw" ]
     72   if [ "$muxchk" = "muxdata" ] && [ "$type" = ".raw" ]
    7273   then
    7374      sum=($line)
     
    103104echo "Wrote checksums to ${checkpath}/tape_${id}.md5.lapalma and ${checkpath}/tape_${id}.md5.wue. Comparing now."
    104105
    105 
    106106# check for differences in the checksums
    107107output=`diff ${checkpath}/tape_${id}.md5.lapalma ${checkpath}/tape_${id}.md5.wue`
     
    109109if [ "$output" = "" ]
    110110then
    111    echo "All checksums are ok! Launching movingrawfiles now."# to be included
     111   echo "All checksums are identical!"
     112   muxschk=`grep muxdata/20[01][0-9].*/20[01][0-9].*.raw ${checkpath}/tape_${id}.md5.wue | wc -l`
     113   if [ $muxslog == $muxschk ]
     114   then
     115      echo "Number of checked files matches. Launching movingrawfiles now. (to be included)" | tee -a ${checkpath}/tape_${id}.md5.lapalma | tee -a ${checkpath}/tape_${id}.md5.wue
     116   else
     117      echo "Number of checked files doesn't match number of extracted files. Something went wrong..." | tee -a ${checkpath}/tape_${id}.md5.lapalma | tee -a ${checkpath}/tape_${id}.md5.wue
     118   fi
    112119else
    113120   echo -e "The files are not identical! diff found the following differences:\n$output"
  • trunk/MagicSoft/Mars/datacenter/scripts/webupdate-callisto

    r8482 r9114  
    3838
    3939echo "do rsync for callisto files" >> $scriptlog 2>&1
    40 rsync -av --delete --exclude=*/*/*_E[.]root --exclude=*/*/callisto.rc $datapath/callisto/ $webpath/callisto >> $scriptlog 2>&1
     40rsync -av --delete --exclude=*/*/20[01][0-9]*_Y_*[.]root --exclude=*/*/callisto.rc $datapath/callisto/ $webpath/callisto >> $scriptlog 2>&1
    4141
    4242echo "do rsync for subsystem files" >> $scriptlog 2>&1
  • trunk/MagicSoft/Mars/datacenter/scripts/webupdate-star

    r8482 r9114  
    3838
    3939echo "do rsync for star files" >> $scriptlog 2>&1
    40 rsync -av --delete --exclude=*/*/*_E[.]root $datapath/star/ $webpath/star >> $scriptlog 2>&1
     40rsync -avn --delete --exclude=*/*/20[01][0-9]*_I_*[.]root $datapath/star/ $webpath/star >> $scriptlog 2>&1
    4141
    4242echo "do rsync for star files from la palma" >> $scriptlog 2>&1
    43 rsync -av --delete --exclude=*/*_E[.]root --exclude=*/Time*.dat /scratch/lapalma/star/ $webpath/star_lapalma >> $scriptlog 2>&1
     43rsync -avn --delete --exclude=*/20[01][0-9]*_I_*[.]root --exclude=*/Time*.dat /scratch/lapalma/star/ $webpath/star_lapalma >> $scriptlog 2>&1
    4444
    4545echo "do rsync for sequence files" >> $scriptlog 2>&1
  • trunk/MagicSoft/Mars/datacenter/scripts/zipscript

    r9093 r9114  
    1919#
    2020#   Author(s): Daniela Dorner  09/2006 <mailto:dorner@astro.uni-wuerzburg.de>
     21#   Author(s): Stefan Ruegamer 08/2008 <mailto:snruegam@astro.uni-wuerzburg.de>
    2122#
    2223#   Copyright: MAGIC Software Development, 2000-2007
     
    5556for file in ${files[@]}
    5657do
    57    echo "processing file $file..." >> $scriptlog 2>&1
     58   if ! [ -f $file ]
     59   then
     60      continue
     61   fi
     62   
     63   echo -e "\nprocessing file $file..." >> $scriptlog 2>&1
    5864   runno=`basename $file | sed -e 's/.*20[01][0-9]\{5\}_\(M[12]_\)\?.*\([0-9]\{8\}\).\([0-9]\{3\}\)\?.*/\2/'`
    5965   fileno=`basename $file | sed -e 's/.*20[01][0-9]\{5\}_\(M[12]_\)\?.*\([0-9]\{8\}\).\([0-9]\{3\}\)\?.*/\3/'`
     
    6975      telno=1
    7076   fi
     77   
     78   # get the sequence corresponding to the run
    7179   query="SELECT fSequenceFirst FROM RunData WHERE fRunNumber="$runno" AND fFileNumber="$fileno" AND fTelescopeNumber="$telno
    72    echo " sending query: $query" >> $scriptlog 2>&1 
     80   echo " sending query: $query" >> $scriptlog 2>&1
    7381   if ! seq=`sendquery`
    7482   then
    75       echo "querying seq for run M_${telno}${runno}.${fileno} from the db did not work -> continue" >> $scriptlog 2>&1
    76       printprocesslog "WARN query $seq for run M_${telno}${runno}.${fileno} from the db did not work"
     83      echo "querying seq for run M${telno}_${runno}.${fileno} from the db did not work -> continue" >> $scriptlog 2>&1
     84      printprocesslog "WARN query $seq for run M${telno}_${runno}.${fileno} from the db did not work"
    7785      continue
    7886   fi
    79    if [ "$seq" == "" ]
     87   if [ "$seq" == "" ] || [ "$seq" == "0" ]
    8088   then
    81       echo "no seq found for run M_${telno}${runno}.${fileno} -> locking only run..." >> $scriptlog 2>&1
    82       seq=$runno
     89      echo "no seq found for run M${telno}_${runno}.${fileno} -> locking only run..." >> $scriptlog 2>&1
     90      seq=${runno}.${fileno}
    8391   fi
    84    echo "locking sequence $seq..."  >> $scriptlog 2>&1
     92   
     93   # lock the sequence against zipscript
     94   echo "locking sequence ${seq}-${telno}..."  >> $scriptlog 2>&1
    8595   lockfile=$lockpath/calzip${seq}-${telno}.txt
    8696   checklock continue >> $scriptlog 2>&1
    87    query="UPDATE SequenceProcessStatus set fNotZipping=NULL WHERE fSequenceFirst=$seq"
    88    echo " sending query: $query" >> $scriptlog 2>&1
     97   
     98   # lock the run in the db
     99   query="UPDATE SequenceProcessStatus set fNotZipping=NULL WHERE fSequenceFirst=$seq AND fTelescopeNumber=$telno"
     100   echo " sending query: $query" >> $scriptlog 2>&1
    89101   if ! sendquery
    90102   then
    91       echo "locking $seq for callisto in db did not work ..." >> $scriptlog 2>&1
    92       printprocesslog "WARN locking $seq for callisto in db did not work"
     103      echo "locking ${seq}-${telno} for callisto in db did not work ..." >> $scriptlog 2>&1
     104      printprocesslog "WARN locking ${seq}-${telno} for callisto in db did not work"
    93105      rm -v $lockfile >> $scriptlog 2>&1
    94106      continue
    95107   fi
     108   
     109   # zip the run
    96110   echo "zipping $file ..." >> $scriptlog 2>&1
    97111   if ssh -xn phoenix nice -n 19 gzip -1f $file >> $scriptlog 2>&1
     
    102116      printprocesslog "WARN zipping $file did not work"
    103117   fi
    104    echo "unlocking sequence $seq..."  >> $scriptlog 2>&1
    105    query="UPDATE SequenceProcessStatus set fNotZipping=Now() WHERE fSequenceFirst=$seq"
    106    echo " sending query: $query" >> $scriptlog 2>&1
     118   
     119   # unlock the sequence in the db
     120   echo "unlocking sequence ${seq}-${telno}..."  >> $scriptlog 2>&1
     121   query="UPDATE SequenceProcessStatus set fNotZipping=Now() WHERE fSequenceFirst=$seq AND fTelescopeNumber=$telno"
     122   echo " sending query: $query" >> $scriptlog 2>&1
    107123   if ! sendquery
    108124   then
    109       echo "unlocking $seq for callisto in db did not work ..." >> $scriptlog 2>&1
    110       printprocesslog "ERROR unlocking $seq for callisto in db did not work"
     125      echo "unlocking ${seq}-${telno} for callisto in db did not work ..." >> $scriptlog 2>&1
     126      printprocesslog "ERROR unlocking ${seq}-${telno} for callisto in db did not work"
    111127      rm -v $lockfile >> $scriptlog 2>&1
    112128      continue
Note: See TracChangeset for help on using the changeset viewer.