Ignore:
Timestamp:
08/25/06 22:09:49 (18 years ago)
Author:
Daniela Dorner
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.