Ignore:
Timestamp:
05/17/05 16:53:35 (20 years ago)
Author:
Daniela Dorner
Message:
*** empty log message ***
File:
1 edited

Legend:

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

    r7037 r7051  
    3636cd /home/operator/Mars.cvs
    3737
     38datetime=`date +%F-%H-%M-%S`
     39year=`date +%Y`
     40
     41scriptlogpath=$logpath/run/insertdatasets/`date +%Y/%m`
     42if [ ! -d $scriptlogpath ]
     43then
     44  mkdir -pv $scriptlogpath
     45  if [ ! -d $scriptlogpath ]
     46  then
     47     echo "could not make scriptlogpath "$scriptlogpath
     48     exit
     49  fi
     50fi
     51
     52scriptlog=$scriptlogpath/insertdatasets-$datetime.log
     53
     54date >> $scriptlog 2>&1
     55
     56date > $lockpath/lock-insertdatasets.txt >> $scriptlog 2>&1
     57checklock0=$?
     58case $checklock0 in
     59    0)   echo "checklock0=$checklock0 -> continue " >> $scriptlog 2>&1;;
     60    1)   echo "checklock0=$checklock0 -> file exists " >> $scriptlog 2>&1
     61         echo "-> getting list for callisto is running -> exit" >> $scriptlog 2>&1
     62         date  >> $scriptlog 2>&1
     63         exit;;
     64    *)   echo "checklock0=$checklock0 -> something went completely wrong" >> $scriptlog 2>&1;;
     65esac
     66
    3867
    3968datasetfiles=(`ls /magic/datasets/*/*`)
    40 echo "datasetfiles: "${datasetfiles[@]}
    41 echo ""
     69echo "datasetfiles: "${datasetfiles[@]}  >> $scriptlog 2>&1
     70echo "" >> $scriptlog 2>&1
    4271
    4372for datasetfile in ${datasetfiles[@]}
     
    4877   if [ "$no" = "$no3" ]
    4978   then
    50       echo "number in filename and in file are the same -> continue"
     79      echo "number in filename and in file are the same -> continue" >> $scriptlog 2>&1
    5180   else
    52       echo "number in filename and in file are not the same "
    53       echo " -> continue with next dataset"
     81      echo "number in filename and in file are not the same " >> $scriptlog 2>&1
     82      echo " -> continue with next dataset" >> $scriptlog 2>&1
    5483      continue
    5584   fi
    56    source=`grep 'SourceName:' $datasetfile | sed -e 's/SourceName://g' | sed -e 's/ //g' | sed -e 's/#//g'`
    57    mode=`grep 'WobbleMode:' $datasetfile`
    58    mode2=`echo $mode | grep ^\#`
     85   source=`grep 'SourceName:' $datasetfile | sed -e 's/SourceName://g' | sed -e 's/ //g' | sed -e 's/#//g'` >> $scriptlog 2>&1
     86   mode=`grep 'WobbleMode:' $datasetfile` >> $scriptlog 2>&1
     87   mode2=`echo $mode | grep ^\#` >> $scriptlog 2>&1
    5988   if [ "$mode2" = "" ]
    6089   then
    61       wobble="Y"
     90      wobble="Y" >> $scriptlog 2>&1
    6291   else
    63       wobble="N"
     92      wobble="N" >> $scriptlog 2>&1
    6493   fi
    65    echo "file: "$datasetfile
    66    echo "  datasetno:  "$no2
    67    echo "  sourcename: "$source
    68    echo "  wobble:     "$wobble
    69    echo " "
    70 #   check0=`root -q -b $macrospath/insertdataset.C+\("\"$no\""\,"\"$source\""\,"\"$type\""\) | tee $insertdatasetlog | grep int | sed -e 's/(int)//'`
    71    check0=`root -q -b $macrospath/insertdataset.C+\("\"$no2\""\,"\"$source\""\,"\"$wobble\"",kFALSE\) | grep int | sed -e 's/(int)//'`
     94   echo "file: "$datasetfile >> $scriptlog 2>&1
     95   echo "  datasetno:  "$no2 >> $scriptlog 2>&1
     96   echo "  sourcename: "$source >> $scriptlog 2>&1
     97   echo "  wobble:     "$wobble >> $scriptlog 2>&1
     98   echo " " >> $scriptlog 2>&1
     99   
     100   insertdatasetpath=$logpath/insertdataset/$no3
     101   if [ ! -d $insertdatasetpath ]
     102      then
     103      mkdir -pv $insertdatasetpath >> $scriptlog 2>&1
     104      if [ ! -d $insertdatasetpath ]
     105      then
     106         echo "could not make insertdatasetpath "$insertdatasetpath >> $scriptlog 2>&1
     107         continue
     108      fi
     109   fi
     110   insertdatasetlog=$insertdatasetpath/insertdataset-$no3.log
     111   check0=`root -q -b $macrospath/insertdataset.C+\("\"$no2\""\,"\"$source\""\,"\"$wobble\"",kFALSE\) | tee $insertdatasetlog | grep int | sed -e 's/(int)//'`
    72112   case $check0 in
    73       1)   echo "check0=$check0 -> everthing ok ";;
    74       *)   echo "check0=$check0 -> ERROR ";;
     113      1)   echo "check0=$check0 -> everthing ok " >> $scriptlog 2>&1 ;;
     114      *)   echo "check0=$check0 -> ERROR " >> $scriptlog 2>&1 ;;
    75115   esac
    76116done
    77117
     118rm -v $todofile >> $scriptlog 2>&1
     119rm -v $lockpath/lock-insertdatasets.txt >> $scriptlog 2>&1
    78120
     121set +C
     122
     123date  >> $scriptlog 2>&1
     124
     125
Note: See TracChangeset for help on using the changeset viewer.