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/insertdatasets

    r7938 r7944  
    3232#
    3333
     34source `dirname $0`/sourcefile
     35printprocesslog "INFO starting $0"
    3436program=insertdatasets
    35 source `dirname $0`/sourcefile
    3637
    3738set -C
    3839
    39 cd $mars
    40 
    41 datetime=`date +%F-%H-%M-%S`
    42 lockfile=$lockpath/lock-insertdatasets.txt
    43 
    44 scriptlogpath=$runlogpath/$program
    45 makedir $scriptlogpath
    46 
    47 scriptlog=$scriptlogpath/insertdatasets-$datetime.log
    48 
     40scriptlog=$runlogpath/$program-$datetime.log
    4941date >> $scriptlog 2>&1
    5042
    5143# check if script is already running
     44lockfile=$lockpath/lock-$program.txt
    5245checklock  >> $scriptlog 2>&1
    5346
     
    5750echo "" >> $scriptlog 2>&1
    5851
     52cd $mars
     53
    5954# extract information from dataset file and insert it into db with the macro insertdataset.C
     55printprocesslog "INFO inserting dataset information into db"
    6056for datasetfile in ${datasetfiles[@]}
    6157do
     
    7470      echo "number in filename and in file are not the same " >> $scriptlog 2>&1
    7571      echo " -> continue with next dataset" >> $scriptlog 2>&1
     72      printprocesslog "ERROR number in filename and file are not the same for dataset $no2"
    7673      continue
    7774   fi
     
    9895   insertdatasetlog=$insertdatasetpath/insertdataset-$no3.log
    9996
     97   printprocesslog "INFO inserting dataset $no2"
    10098   # insert information into db
    10199   check0=`root -q -b $macrospath/insertdataset.C+\("\"$no2\""\,"\"$source\""\,"\"$wobble\""\,"\"$comment\""\,kFALSE\) | tee $insertdatasetlog | grep int | sed -e 's/(int)//'`
    102100   case $check0 in
    103       1)   echo "check0=$check0 -> everything ok " >> $scriptlog 2>&1 ;;
    104       *)   echo "check0=$check0 -> ERROR " >> $scriptlog 2>&1 ;;
     101      1)   echo " check0=$check0 -> everything ok " >> $scriptlog 2>&1
     102           printprocesslog "INFO dataset $no2 successfully inserted"
     103           ;;
     104      0)   echo " check1=$check1 -> no connection to db -> continue..." >> $scriptlog 2>&1
     105           printprocesslog "WARN connection to DB failed"
     106           check="no"
     107           ;;
     108      *)   echo " check0=$check0 -> ERROR " >> $scriptlog 2>&1
     109           printprocesslog "ERROR $program.C failed for dataset $no2"
     110           ;;
    105111   esac
    106112done
    107113
    108 rm -v $lockfile >> $scriptlog 2>&1
     114finish >> $scriptlog 2>&1
    109115
    110 set +C
    111 
    112 date  >> $scriptlog 2>&1
    113 
Note: See TracChangeset for help on using the changeset viewer.