Changeset 7944 for trunk/MagicSoft/Mars/datacenter/scripts/correcttime
- Timestamp:
- 08/25/06 22:09:49 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/datacenter/scripts/correcttime
r7938 r7944 37 37 # 38 38 39 source `dirname $0`/sourcefile 40 printprocesslog "INFO starting $0" 39 41 program=correct_raw_time 40 source `dirname $0`/sourcefile41 42 42 column=fTimingCorrection 43 43 44 lockfile=$lockpath/lock-$program.txt 45 scriptlogpath=$runlogpath/$program 44 scriptlog=$runlogpath/$program-$datetime.log 45 date >> $scriptlog 2>&1 46 46 47 47 if [ -e $todofile ] 48 48 then 49 echo "$program is already running -> exit" 49 echo "$program is already running -> exit" >> $scriptlog 2>&1 50 50 exit 51 51 fi … … 58 58 if [ "$runs" = "" ] 59 59 then 60 echo "nothing to do -> exit" 60 echo "nothing to do -> exit" >> $scriptlog 2>&1 61 61 finish >> $scriptlog 2>&1 62 62 fi 63 echo "runs: "${runs[@]} 64 rm -v $todofile >> $scriptlog 2>&1 63 echo "runs: "${runs[@]} >> $scriptlog 2>&1 65 64 66 65 cd $mars … … 68 67 for run in ${runs[@]} 69 68 do 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 81 81 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 89 85 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 92 89 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 102 103 done 103 104
Note:
See TracChangeset
for help on using the changeset viewer.