Ignore:
Timestamp:
05/09/07 17:05:15 (18 years ago)
Author:
Daniela Dorner
Message:
*** empty log message ***
File:
1 edited

Legend:

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

    r8454 r8482  
    2020#   Author(s): Daniela Dorner  08/2004 <mailto:dorner@astro.uni-wuerzburg.de>
    2121#
    22 #   Copyright: MAGIC Software Development, 2000-2006
     22#   Copyright: MAGIC Software Development, 2000-2007
    2323#
    2424#
     
    5151sequence=$process
    5252
    53 # lock sequ
     53# lock sequ for cal
    5454lockfile=$lockpath/lock-$table-$column-$sequence.txt
    5555checklock >> $scriptlog 2>&1
     
    6262no=`printf %08d $sequence | cut -c 0-4`
    6363no2=`printf %08d $sequence`
    64 var1=$no
    65 var2=$no2
    6664outpath="$datapath/$program/$no/$no2"
    6765makedir $outpath >> $scriptlog 2>&1
     
    8078   if [ $sequence -gt 200000 ]
    8179   then
    82         ln -vs $callistorcmux $outpath/callisto.rc >> $scriptlog 2>&1
     80      ln -vs $callistorcmux $outpath/callisto.rc >> $scriptlog 2>&1
    8381   else
    84         ln -vs $callistorcnew $outpath/callisto.rc >> $scriptlog 2>&1
     82      ln -vs $callistorcnew $outpath/callisto.rc >> $scriptlog 2>&1
    8583   fi
    8684   callistorcseq=$outpath/callisto.rc
    8785fi
    8886
     87# lock sequ for zipping
     88lockfile=$lockpath/calzip$sequence.txt
     89# if lockfile is already existing, 1 is returned
     90if ! checklock return 1 >> $scriptlog 2>&1
     91then
     92   # reset lockfile name
     93   lockfile=$lockpath/lock-$table-$column-$sequence.txt
     94   finish >> $scriptlog 2>&1
     95fi
     96
     97primvar=$no2
    8998setstatus "start" >> $scriptlog 2>&1
    9099
     
    92101./callisto -b -q -v4 -f --log=$outpath/$program$no2.log --html=$outpath/$program$no2.html --out=$outpath --config=$callistorcseq $sequfile  2>> $scriptlog > /dev/null
    93102check1=$?
     103
     104# remove lockfile for zip and reset lockfile name
     105rm -v $lockfile >> $scriptlog 2>&1
     106lockfile=$lockpath/lock-$table-$column-$sequence.txt
    94107
    95108case $check1 in
     
    117130           # find cc and caco file
    118131           # if file is missing continue with next sequence
     132           date=`date --date \`basename $calfile | cut -d_ -f1 +%Y/%m/%d\``
     133           ccpath=$subsystempath/cc/$date
     134           cacopath=$subsystempath/caco/$date
    119135           runno=`echo $calfile | cut -d_ -f2 | sed -e 's/^0//' | sed -e 's/^0//' | sed -e 's/^0//' `
    120            ccfile=`find /magic/subsystemdata/cc/ -name [2][0][0-2][0-9][0,1][0-9][0-3][0-9]_*${runno}_[P,D,C,S]_*_S.rep -and ! -name [2][0][0-2][0-9][0,1][0-9][0-3][0-9]_*[1-9]${runno}_[P,D,C,S]_*_S.rep`
     136           ccfile=`find $ccpath -name 20[0-2][0-9][01][0-9][0-3][0-9]_*${runno}_[PDCS]_*_S.rep`
    121137           source=`echo $ccfile | cut -d_ -f4`
    122            cacofile=`find /magic/subsystemdata/caco/ -name dc_[2][0][0-2][0-9]_[0,1][0-9]_[0-3][0-9]_*${runno}_${source}.txt -and ! -name dc_[2][0][0-2][0-9]_[0,1][0-9]_[0-3][0-9]_*[1-9]${runno}_${source}.txt`
    123 #            cacofile=`find /magic/subsystemdata/caco/ -name dc_[2][0][0-2][0-9]_[0,1][0-9]_[0-3][0-9]_*${runno}_*.txt`
     138           cacofile=`find /magic/subsystemdata/caco/$date -name dc_20[0-2][0-9]_[01][0-9]_[0-3][0-9]_*${runno}_${source}.txt`
    124139           if [ "$ccfile" = "" ]
    125140           then
     
    138153              do
    139154                 newrun=`echo $runno - $i | bc`
    140                  path=`dirname $ccfile`
    141                  path=`echo $path | sed -e 's/cc/caco/'`
    142                  echo "path: "$path >> $scriptlog 2>&1
    143                  cacofile=`find $path -name *$newrun*`
     155                 cacofile=`find $cacopath -name *$newrun*`
    144156                 if [ "$cacofile" = "" ]
    145157                 then
    146158                    if [ $i -eq 9 ]
    147159                    then
    148                        echo "no cacofile found" >> $scriptlog 2>&1
     160                       echo "no cacofile found for runno $newrun in $cacopath" >> $scriptlog 2>&1
    149161                       printprocesslog "ERROR cacofile $cacofile not found for $calfile"
    150162                       com=$Fnocacofile
     
    164176           check2=$?
    165177           case $check2 in
    166                    0)   echo " check2=$check2 -> everything ok, merppccupdate worked -> continue" >> $scriptlog 2>&1
    167                         printprocesslog "INFO merppupdated $calfile sucessfully with $ccfile"
    168                         ;;
    169                    *)   echo " check2=$check2 -> ERROR -> merppccupdate failed" >> $scriptlog 2>&1
    170                         printprocesslog "ERROR merppccupdate with file $ccfile failed for $calfile"
    171                         com=$Fmerppcc
    172                         comadd=$runno
    173                         check=$check2
    174                         break ;;
     178              0)   echo " check2=$check2 -> everything ok, merppccupdate worked -> continue" >> $scriptlog 2>&1
     179                   printprocesslog "INFO merppupdated $calfile sucessfully with $ccfile"
     180                   ;;
     181              *)   echo " check2=$check2 -> ERROR -> merppccupdate failed" >> $scriptlog 2>&1
     182                   printprocesslog "ERROR merppccupdate with file $ccfile failed for $calfile"
     183                   com=$Fmerppcc
     184                   comadd=$runno
     185                   check=$check2
     186                   break ;;
    175187           esac
    176188           echo "./merpp -u --log=$merpplogpath/merppcacoupdate$runno.log --html=$merpplogpath/merppcacoupdate$runno.html --auto-time $cacofile $calfile 2>> $scriptlog> /dev/null" >> $scriptlog 2>&1
     
    178190           check3=$?
    179191           case $check3 in
    180                    0)   echo " check3=$check3 -> everything ok, merppcacoupdate worked -> continue" >> $scriptlog 2>&1
    181                         printprocesslog "INFO merppupdated $calfile sucessfully with $cacofile"
    182                         ;;
    183                    *)   echo " check3=$check3 -> ERROR -> merppcacoupdate failed" >> $scriptlog 2>&1
    184                         printprocesslog "ERROR merppcacoupdate with file $cacofile failed for $calfile"
    185                         com=$Fmerppcaco
    186                         comadd=$runno
    187                         check=$check3
    188                         break ;;
     192              0)   echo " check3=$check3 -> everything ok, merppcacoupdate worked -> continue" >> $scriptlog 2>&1
     193                   printprocesslog "INFO merppupdated $calfile sucessfully with $cacofile"
     194                   ;;
     195              *)   echo " check3=$check3 -> ERROR -> merppcacoupdate failed" >> $scriptlog 2>&1
     196                   printprocesslog "ERROR merppcacoupdate with file $cacofile failed for $calfile"
     197                   com=$Fmerppcaco
     198                   comadd=$runno
     199                   check=$check3
     200                   break ;;
    189201           esac
    190202        done
Note: See TracChangeset for help on using the changeset viewer.