Ignore:
Timestamp:
02/19/09 21:22:19 (16 years ago)
Author:
Daniela Dorner
Message:
*** empty log message ***
File:
1 edited

Legend:

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

    r8482 r9355  
    3838set -C
    3939
    40 scriptlog=$runlogpath/$program-$datetime.log
    41 date >> $scriptlog 2>&1
    42 
    4340# check if script is already running
    4441lockfile=$lockpath/lock-$program.txt
    45 checklock  >> $scriptlog 2>&1
     42checklock
    4643
    4744# get all datasetfiles
    4845datasetfiles=(`ls $datasetpath/*/*.txt`)
    49 echo "datasetfiles: "${datasetfiles[@]}  >> $scriptlog 2>&1
    50 echo "" >> $scriptlog 2>&1
     46printprocesslog "INFO datasetfiles: "${datasetfiles[@]}
    5147
    5248cd $mars
     
    6662   if [ "$no" = "$no3" ]
    6763   then
    68       echo "number in filename and in file are the same -> continue" >> $scriptlog 2>&1
     64      printprocesslog "INFO number in filename and in file are the same -> continue"
    6965   else
    70       echo "number in filename and in file are not the same " >> $scriptlog 2>&1
    71       echo " -> continue with next dataset" >> $scriptlog 2>&1
    7266      printprocesslog "ERROR number in filename ($no) and file ($no3) are not the same for dataset $no2"
    7367      continue
    7468   fi
    7569   # get source name, comment and observation mode from dataset file
    76    source=`grep 'SourceName:' $datasetfile | sed -e 's/SourceName://g' | sed -e 's/ //g' | sed -e 's/#//g'` >> $scriptlog 2>&1
    77    comment=`grep 'Comment:' $datasetfile | sed -e 's/Comment://g'` >> $scriptlog 2>&1
    78    mode=`grep 'WobbleMode:' $datasetfile` >> $scriptlog 2>&1
    79    mode2=`echo $mode | grep ^\#` >> $scriptlog 2>&1
     70   source=`grep 'SourceName:' $datasetfile | sed -e 's/SourceName://g' | sed -e 's/ //g' | sed -e 's/#//g'`
     71   comment=`grep 'Comment:' $datasetfile | sed -e 's/Comment://g'`
     72   mode=`grep 'WobbleMode:' $datasetfile`
     73   mode2=`echo $mode | grep ^\#`
    8074   if [ "$mode2" = "" ]
    8175   then
    82       wobble="Y" >> $scriptlog 2>&1
     76      wobble="Y"
    8377   else
    84       wobble="N" >> $scriptlog 2>&1
     78      wobble="N"
    8579   fi
    86    echo "file: "$datasetfile >> $scriptlog 2>&1
    87    echo "  datasetno:  "$no2 >> $scriptlog 2>&1
    88    echo "  sourcename: "$source >> $scriptlog 2>&1
    89    echo "  wobble:     "$wobble >> $scriptlog 2>&1
    90    echo "  comment:    "$comment >> $scriptlog 2>&1
    91    echo " " >> $scriptlog 2>&1
    9280   
    9381   insertdatasetpath=$logpath/insertdataset/$no4
    94    makedir $insertdatasetpath >> $scriptlog 2>&1
     82   makedir $insertdatasetpath
    9583   insertdatasetlog=$insertdatasetpath/insertdataset-$no3.log
    9684
     
    9987   check0=`root -q -b $macrospath/insertdataset.C+\("\"$no2\""\,"\"$source\""\,"\"$wobble\""\,"\"$comment\""\,kFALSE\) | tee $insertdatasetlog | intgrep`
    10088   case $check0 in
    101       1)   echo " check0=$check0 -> everything ok " >> $scriptlog 2>&1
    102            printprocesslog "INFO dataset $no2 successfully inserted"
     89      1)   printprocesslog "INFO dataset $no2 successfully inserted (check0=$check0)"
    10390           ;;
    104       3)   echo " check0=$check0 -> everything ok " >> $scriptlog 2>&1
    105            printprocesslog "INFO dataset $no2 exists already"
     91      3)   printprocesslog "INFO dataset $no2 exists already (check0=$check0)"
    10692           ;;
    107       0)   echo " check1=$check1 -> no connection to db -> continue..." >> $scriptlog 2>&1
    108            printprocesslog "WARN connection to DB failed"
     93      0)   printprocesslog "WARN connection to DB failed (check0=$check0)"
    10994           check="no"
    11095           ;;
    111       *)   echo " check0=$check0 -> ERROR " >> $scriptlog 2>&1
    112            printprocesslog "ERROR $program.C failed for dataset $no2"
     96      *)   printprocesslog "ERROR $program.C failed for dataset $no2 (check0=$check0)"
    11397           ;;
    11498   esac
    11599done
    116100
    117 finish >> $scriptlog 2>&1
     101finish
    118102
Note: See TracChangeset for help on using the changeset viewer.