Changeset 18694 for trunk/DataCheck


Ignore:
Timestamp:
12/18/16 23:46:07 (8 years ago)
Author:
Daniela Dorner
Message:
introduced usage of file for mysql pw to avoid warnings
Location:
trunk/DataCheck
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/DataCheck/QuickLook/SendData.sh

    r18672 r18694  
    55printprocesslog "INFO starting $0"
    66
    7 echo "Sent data"
     7echo "Sent data."
    88
    99start=$1
     
    1717
    1818query="SELECT fSourceName FROM Source WHERE fSourceKey="$source
     19#echo $query
    1920sourcename=`sendquery`
    2021
     
    6465   getdbsetup
    6566   printprocesslog "DEBUG sendquery QUERY: "$query
    66    mysql -s -u $us --password=$pw --host=$ho $db -e " $query "
     67   mysql $pwfile -s -u $us $pw --host=$ho $db -e " $query "
    6768}
    6869
     
    7980   mjd)  timeselect="Mjd(Min(fRunStart)) AS start, Mjd(MAX(fRunStop)) AS stop, "
    8081         timeselect2=" Mjd(MIN(o.start)) AS start, Mjd(MAX(o.stop)) AS stop, "
    81          break;;
     82         ;;
    8283   unix) timeselect="Unix_timestamp(CONVERT_TZ(Min(fRunStart), '+00:00', 'SYSTEM')) AS start, Unix_timestamp(CONVERT_TZ(Max(fRunStop), '+00:00', 'SYSTEM')) AS stop, "
    8384         timeselect2=" Unix_timestamp(CONVERT_TZ(MIN(o.start), '+00:00', 'SYSTEM')) AS start, Unix_timestamp(CONVERT_TZ(MAX(o.stop), '+00:00', 'SYSTEM')) AS stop, "
    84          break;;
     85         ;;
    8586   *)    timeselect="MIN(fRunStart) AS start, MAX(fRunStop) AS stop, "
    8687         timeselect2=" MIN(o.start) AS start, MAX(o.stop) as stop, "
    87          break;;
     88         ;;
    8889esac
    8990
     
    120121
    121122#printinfo | mail -a "From: dorner@astro.uni-wuerzburg.de" -s 'test downloading data ' -b dorner@astro.uni-wuerzburg.de $email
    122 printinfo | mail -s 'FACT data (test download)' -c dorner@astro.uni-wuerzburg.de -r dorner@astro.uni-wuerzburg.de $email
     123printinfo | mail -s 'FACT data (test download)' -b dorner@astro.uni-wuerzburg.de -r dorner@astro.uni-wuerzburg.de $email
    123124#printinfo
    124125
  • trunk/DataCheck/QuickLook/SendData_Internal.sh

    r18672 r18694  
    8383   printprocesslog "DEBUG sendquery QUERY: "$query
    8484   echo "DEBUG sendquery QUERY: "$query
    85    mysql -s -u $us --password=$pw --host=$ho $db -e " $query "
     85   mysql $pwfile -s -u $us $pw --host=$ho $db -e " $query "
    8686   if [ "$table" == "AnalysisResultsRunLP" ]
    8787   then
    8888      query2=`echo $query | sed -e 's/AnalysisResultsRunLP/AnalysisResultsRunISDC/g'`
    8989      echo "# QUERY: "$query2
    90       mysql -s -u $us --password=$pw --host=$ho factdata_cp20150811 -e " $query2 "
    91    fi
     90      mysql $pwfile -s -u $us $pw --host=$ho factdata_cp20150811 -e " $query2 "
     91      fi
    9292}
    9393
     
    132132   mjd)  timeselect="Mjd(Min(fRunStart)) AS start, Mjd(MAX(fRunStop)) AS stop, "
    133133         timeselect2=" Mjd(MIN(o.start)) AS start, Mjd(MAX(o.stop)) AS stop, "
    134          break;;
     134         ;;
    135135   unix) timeselect="Unix_timestamp(CONVERT_TZ(Min(fRunStart), '+00:00', 'SYSTEM')) AS start, Unix_timestamp(CONVERT_TZ(Max(fRunStop), '+00:00', 'SYSTEM')) AS stop, "
    136136         timeselect2=" Unix_timestamp(CONVERT_TZ(MIN(o.start), '+00:00', 'SYSTEM')) AS start, Unix_timestamp(CONVERT_TZ(MAX(o.stop), '+00:00', 'SYSTEM')) AS stop, "
    137          break;;
     137         ;;
    138138   *)    timeselect="MIN(fRunStart) AS start, MAX(fRunStop) AS stop, "
    139139         timeselect2=" MIN(o.start) AS start, MAX(o.stop) as stop, "
    140          break;;
     140         ;;
    141141esac
    142142
     
    155155   query="SELECT "$timeselect" SUM(fNumExcEvts)/SUM("$ontimeif")*3600 AS excrate, "
    156156   query=$query" ExcErr(Sum(fNumSigEvts), SUM(fNumBgEvts))/SUM("$ontimeif")*3600 AS excerr, "
     157   query=$query" SUM("$ontimeif"/60.) AS ontime, "
    157158   query=$query" IF (SUM(fNumSigEvts)>10 AND SUM(fNumBgEvts)>10, LiMa(SUM(fNumSigEvts), SUM(fNumBgEvts)), IF (SUM(fNumSigEvts)-SUM(fNumBgEvts)>10, concat('(', LiMa(SUM(fNumSigEvts), SUM(fNumBgEvts)), ')'), '-')) AS significance, "
    158159   query=$query" LiMa(SUM(fNumSigEvts), SUM(fNumBgEvts)) AS significance2, "
     
    179180#echo $query
    180181
    181 printinfo | mail -s 'test internal downloading data ' -c dorner@astro.uni-wuerzburg.de -r dorner@astro.uni-wuerzburg.de $email
     182printinfo | mail -s 'test internal downloading data ' -b dorner@astro.uni-wuerzburg.de -r dorner@astro.uni-wuerzburg.de $email
    182183#printinfo
    183184
  • trunk/DataCheck/Setup/setup.fact.lp.data

    r18667 r18694  
    5353# dependencies of steps
    5454steps=$mars/resources/steps_fact.rc
    55 # file with db information
     55# files with db information
    5656sqlrc=$mars/sql.rc
     57sqlpw=/home/fact/.mysql.pw
    5758
    5859
  • trunk/DataCheck/Setup/setup.fact.lp.gate

    r18393 r18694  
    1212# set only variables which are needed for the scripts running on this machine
    1313
     14# software
     15export mars=/users/fact/SW.automatic.processing/Mars.svn.2014.05.26
     16
    1417# logging and setup
    15 logpath=/users/fact/logs.automatic.processing/autologs
     18user=`whoami`
     19if [ "$user" == "www-data" ]
     20then
     21   # processes called from the web
     22   logpath=/home/factwww/logs.automatic.processing/autologs
     23   # file with db information
     24   sqlrc=/home/fact/sql.rc
     25   sqlpw=/home/fact/.mysql.pw
     26else
     27   # normal processes called from the commandline or cron
     28   logpath=/users/fact/logs.automatic.processing/autologs
     29   # file with db information
     30   sqlrc=$mars/sql.rc
     31   sqlpw=/users/fact/.mysql.pw
     32fi
    1633runlogpath=/users/fact/logs.automatic.processing/autologs
    1734
    18 export mars=/users/fact/SW.automatic.processing/Mars.svn.2014.05.26
    19 
    20 # file with db information
    21 sqlrc=$mars/sql.rc
    22 
  • trunk/DataCheck/Sourcefile.sh

    r18668 r18694  
    127127# alias (we cannot check the beginning of the line due to
    128128# color codes in filldotraw.C)
    129 alias 'intgrep'='grep -E -o \\\(int\\\)[0-9]+$ | grep -E -o [0-9]+'
     129alias 'intgrep'='grep -E -o \\\("(int|Bool_t)"\\\)[0-9]+$ | grep -E -o [0-9]+'
    130130
    131131
     
    168168{
    169169   db=`grep Database $sqlrc | grep -v '#' | sed -e 's/Database: //' -e 's/ //g'`
    170    pw=`grep Password $sqlrc | grep -v '#' | sed -e 's/Password: //' -e 's/ //g'`
     170   pw="--password="`grep Password $sqlrc | grep -v '#' | sed -e 's/Password: //' -e 's/ //g'`
    171171   us=`grep User $sqlrc | grep -v '#' | sed -e 's/User: //' -e 's/ //g'`
    172172   ho=`grep URL $sqlrc | grep -v '#' | sed -e 's/ //g' -e 's/URL:mysql:\/\///'`
     173   if [ "$sqlpw" != "" ]
     174   then
     175      pwfile="--defaults-file=$sqlpw"
     176      pw=""
     177   fi
    173178#   echo "setup: "
    174179#   echo " db: "$db
     
    183188   getdbsetup
    184189   printprocesslog "DEBUG sendquery QUERY: "$query
    185    if ! val=`mysql -s -u $us --password=$pw --host=$ho $db -e " $query "`
     190   if ! val=`mysql $pwfile -s -u $us $pw --host=$ho $db -e " $query "`
    186191   then
    187192      printprocesslog "ERROR could not query DB "$db" on host "$ho" with user "$us
     
    341346   # execute query
    342347   #numproc=`sendquery `#cannot be done with sendquery, because of row counting
    343    if ! numproc=`mysql -s -u $us --password=$pw --host=$ho $db -e " $query " | wc -l`
     348   if ! numproc=`mysql $pwfile -s -u $us $pw --host=$ho $db -e " $query " | wc -l`
    344349   then
    345350      printprocesslog "ERROR could not query number of processes from db (program: $program, function getstatus)"
Note: See TracChangeset for help on using the changeset viewer.