Changeset 18694
- Timestamp:
- 12/18/16 23:46:07 (8 years ago)
- Location:
- trunk/DataCheck
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/DataCheck/QuickLook/SendData.sh
r18672 r18694 5 5 printprocesslog "INFO starting $0" 6 6 7 echo "Sent data "7 echo "Sent data." 8 8 9 9 start=$1 … … 17 17 18 18 query="SELECT fSourceName FROM Source WHERE fSourceKey="$source 19 #echo $query 19 20 sourcename=`sendquery` 20 21 … … 64 65 getdbsetup 65 66 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 " 67 68 } 68 69 … … 79 80 mjd) timeselect="Mjd(Min(fRunStart)) AS start, Mjd(MAX(fRunStop)) AS stop, " 80 81 timeselect2=" Mjd(MIN(o.start)) AS start, Mjd(MAX(o.stop)) AS stop, " 81 break;;82 ;; 82 83 unix) timeselect="Unix_timestamp(CONVERT_TZ(Min(fRunStart), '+00:00', 'SYSTEM')) AS start, Unix_timestamp(CONVERT_TZ(Max(fRunStop), '+00:00', 'SYSTEM')) AS stop, " 83 84 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 ;; 85 86 *) timeselect="MIN(fRunStart) AS start, MAX(fRunStop) AS stop, " 86 87 timeselect2=" MIN(o.start) AS start, MAX(o.stop) as stop, " 87 break;;88 ;; 88 89 esac 89 90 … … 120 121 121 122 #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)' - cdorner@astro.uni-wuerzburg.de -r dorner@astro.uni-wuerzburg.de $email123 printinfo | mail -s 'FACT data (test download)' -b dorner@astro.uni-wuerzburg.de -r dorner@astro.uni-wuerzburg.de $email 123 124 #printinfo 124 125 -
trunk/DataCheck/QuickLook/SendData_Internal.sh
r18672 r18694 83 83 printprocesslog "DEBUG sendquery QUERY: "$query 84 84 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 " 86 86 if [ "$table" == "AnalysisResultsRunLP" ] 87 87 then 88 88 query2=`echo $query | sed -e 's/AnalysisResultsRunLP/AnalysisResultsRunISDC/g'` 89 89 echo "# QUERY: "$query2 90 mysql -s -u $us --password=$pw --host=$ho factdata_cp20150811 -e " $query2 "91 fi90 mysql $pwfile -s -u $us $pw --host=$ho factdata_cp20150811 -e " $query2 " 91 fi 92 92 } 93 93 … … 132 132 mjd) timeselect="Mjd(Min(fRunStart)) AS start, Mjd(MAX(fRunStop)) AS stop, " 133 133 timeselect2=" Mjd(MIN(o.start)) AS start, Mjd(MAX(o.stop)) AS stop, " 134 break;;134 ;; 135 135 unix) timeselect="Unix_timestamp(CONVERT_TZ(Min(fRunStart), '+00:00', 'SYSTEM')) AS start, Unix_timestamp(CONVERT_TZ(Max(fRunStop), '+00:00', 'SYSTEM')) AS stop, " 136 136 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 ;; 138 138 *) timeselect="MIN(fRunStart) AS start, MAX(fRunStop) AS stop, " 139 139 timeselect2=" MIN(o.start) AS start, MAX(o.stop) as stop, " 140 break;;140 ;; 141 141 esac 142 142 … … 155 155 query="SELECT "$timeselect" SUM(fNumExcEvts)/SUM("$ontimeif")*3600 AS excrate, " 156 156 query=$query" ExcErr(Sum(fNumSigEvts), SUM(fNumBgEvts))/SUM("$ontimeif")*3600 AS excerr, " 157 query=$query" SUM("$ontimeif"/60.) AS ontime, " 157 158 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, " 158 159 query=$query" LiMa(SUM(fNumSigEvts), SUM(fNumBgEvts)) AS significance2, " … … 179 180 #echo $query 180 181 181 printinfo | mail -s 'test internal downloading data ' - cdorner@astro.uni-wuerzburg.de -r dorner@astro.uni-wuerzburg.de $email182 printinfo | mail -s 'test internal downloading data ' -b dorner@astro.uni-wuerzburg.de -r dorner@astro.uni-wuerzburg.de $email 182 183 #printinfo 183 184 -
trunk/DataCheck/Setup/setup.fact.lp.data
r18667 r18694 53 53 # dependencies of steps 54 54 steps=$mars/resources/steps_fact.rc 55 # file with db information55 # files with db information 56 56 sqlrc=$mars/sql.rc 57 sqlpw=/home/fact/.mysql.pw 57 58 58 59 -
trunk/DataCheck/Setup/setup.fact.lp.gate
r18393 r18694 12 12 # set only variables which are needed for the scripts running on this machine 13 13 14 # software 15 export mars=/users/fact/SW.automatic.processing/Mars.svn.2014.05.26 16 14 17 # logging and setup 15 logpath=/users/fact/logs.automatic.processing/autologs 18 user=`whoami` 19 if [ "$user" == "www-data" ] 20 then 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 26 else 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 32 fi 16 33 runlogpath=/users/fact/logs.automatic.processing/autologs 17 34 18 export mars=/users/fact/SW.automatic.processing/Mars.svn.2014.05.2619 20 # file with db information21 sqlrc=$mars/sql.rc22 -
trunk/DataCheck/Sourcefile.sh
r18668 r18694 127 127 # alias (we cannot check the beginning of the line due to 128 128 # color codes in filldotraw.C) 129 alias 'intgrep'='grep -E -o \\\( int\\\)[0-9]+$ | grep -E -o [0-9]+'129 alias 'intgrep'='grep -E -o \\\("(int|Bool_t)"\\\)[0-9]+$ | grep -E -o [0-9]+' 130 130 131 131 … … 168 168 { 169 169 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'` 171 171 us=`grep User $sqlrc | grep -v '#' | sed -e 's/User: //' -e 's/ //g'` 172 172 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 173 178 # echo "setup: " 174 179 # echo " db: "$db … … 183 188 getdbsetup 184 189 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 "` 186 191 then 187 192 printprocesslog "ERROR could not query DB "$db" on host "$ho" with user "$us … … 341 346 # execute query 342 347 #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` 344 349 then 345 350 printprocesslog "ERROR could not query number of processes from db (program: $program, function getstatus)"
Note:
See TracChangeset
for help on using the changeset viewer.