Changeset 12985


Ignore:
Timestamp:
03/01/12 15:02:57 (13 years ago)
Author:
Daniela Dorner
Message:
removed check for pw-file, adapted check for modification time, added insert to new run table
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/DataCheck/CheckRawData.sh

    r12980 r12985  
    2323# setup to use ftools
    2424source $HEADAS/headas-init.sh
    25 
    26 pwfile=`dirname $0`/.pw
    27 password=`cat $pwfile 2>/dev/null`
    28 if [ "$password" == "" ]
    29 then
    30    echo "please insert password in $pwfile"
    31    printprocesslog "ERROR password for DB access in $pwfile missing"
    32    finish
    33 fi
    3425
    3526# check if software is available
     
    9182      origfile=`echo $rawfile | sed -e 's/loc_data/daq/'`
    9283
    93       # check if raw file was changed in the last 30 minutes
    94       isnew=`find $file -cmin -30`
    95       if [ "$isnew" != "" ]
    96       then
    97          printprocesslog "INFO "$file" is not older than 30 min. -> continue"
    98          continue
    99       fi
    100 
    10184      # check if it is drs file
    102       isnew=`ls $file | grep drs`
    103       if [ "$isnew" != "" ]
     85      isdrs=`ls $file | grep drs`
     86      if [ "$isdrs" != "" ]
    10487      then
    10588         printprocesslog "INFO "$file" is a drs file. -> continue"
     
    11194      if [ -e $origfile ]
    11295      then
     96         # check if raw file was changed in the last 30 minutes
     97         isnew=`find $origfile -cmin -30`
     98         if [ "$isnew" != "" ]
     99         then
     100            printprocesslog "WARN "$origfile" is not older than 30 min. -> continue"
     101            continue
     102         fi
     103
    113104         # get time of last modification as seconds since Epoch for both files
    114105         timeorig=`stat -c %Y $origfile`
     
    330321      if [ "$result3" == "" ]
    331322      then
     323         query="INSERT RawFileAvailISDC SET fNight="$runnumber", fRunID="$filenumberfromname
     324         sendquery >/dev/null
    332325         query="INSERT"
    333326         querymid=" fNight="$runnumber", fRunID="$filenumberfromname", "
     
    409402      query=$query", fFitsFileErrors="$numfitserrors
    410403      query=$query" "$querystop
    411       printprocesslog "INFO insert/update entry in DB. QUERY: "$query
    412404      # send query to DB
    413405      sendquery >/dev/null
    414       #if ! /usr/bin/mysql -u operator --host=fact01.fact.local --password=$password FactData -e "$query4"
    415       #then
    416       #   printprocesslog "ERROR insert/update of "$numfromfile" to mysql failed."
    417       #   finish
    418       #fi
    419406   done
    420407done
Note: See TracChangeset for help on using the changeset viewer.