Changeset 7944 for trunk/MagicSoft/Mars/datacenter
- Timestamp:
- 08/25/06 22:09:49 (18 years ago)
- Location:
- trunk/MagicSoft/Mars/datacenter/scripts
- Files:
-
- 33 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/datacenter/scripts/buildsequenceentries
r7938 r7944 35 35 # 36 36 37 source `dirname $0`/sourcefile 38 printprocesslog "INFO starting $0" 37 39 program=buildsequenceentries 38 source `dirname $0`/sourcefile 40 column=fSequenceEntriesBuilt 39 41 40 42 set -C 41 43 42 column=fSequenceEntriesBuilt 43 44 lockfile=$lockpath/lock-$program.txt 45 46 scriptlogpath=$runlogpath/$program 47 makedir $scriptlogpath 48 scriptlog=$scriptlogpath/$program-$datetime.log 49 44 scriptlog=$runlogpath/$program-$datetime.log 50 45 date >> $scriptlog 2>&1 51 46 52 47 # check if script is already running 48 lockfile=$lockpath/lock-$program.txt 53 49 checklock >> $scriptlog 2>&1 54 50 … … 71 67 do 72 68 echo "building sequence entries for date $date..." >> $scriptlog 2>&1 69 printprocesslog "INFO build sequence entries for $date" 73 70 year2=`echo $date | cut -c 1-4` 74 71 var1=$year2 … … 83 80 84 81 case $check1 in 85 1) echo " check1=$check1 -> everything ok -> setting status for $date..." >> $scriptlog 2>&1;; 82 1) echo " check1=$check1 -> everything ok -> setting status for $date..." >> $scriptlog 2>&1 83 printprocesslog "INFO sequence entries successfully built for $date" 84 ;; 86 85 0) echo " check1=$check1 -> no connection to db -> continue..." >> $scriptlog 2>&1 86 printprocesslog "WARN connection to DB failed" 87 87 check="no" 88 88 ;; 89 89 *) echo " check1=$check1 -> ERROR - $program.C failed for $date -> step has to be repeated" >> $scriptlog 2>&1 90 printprocesslog "ERROR $program.C failed for $date" 90 91 com=$Fbuildsequ 91 92 check=$check1 -
trunk/MagicSoft/Mars/datacenter/scripts/checkfilesforsequenceavail
r7938 r7944 35 35 # 36 36 37 source `dirname $0`/sourcefile 38 printprocesslog "INFO starting $0" 37 39 program=checkfilesavail 38 source `dirname $0`/sourcefile39 40 40 column=fAllFilesAvail 41 41 42 lockfile=$lockpath/lock-$program.txt 43 44 scriptlogpath=$runlogpath/$program 45 makedir $scriptlogpath 46 scriptlog=$scriptlogpath/$program-$datetime.log 47 42 scriptlog=$runlogpath/$program-$datetime.log 48 43 date >> $scriptlog 2>&1 49 44 50 45 # check if script is already running 46 lockfile=$lockpath/lock-$program.txt 51 47 checklock >> $scriptlog 2>&1 52 48 … … 69 65 do 70 66 echo "checking files for sequence $sequence..." >> $scriptlog 2>&1 67 printprocesslog "INFO checking files for sequence $sequence" 71 68 no=`printf %08d $sequence | cut -c 0-4` 72 69 no2=`printf %08d $sequence` … … 84 81 85 82 case $check1 in 86 1) echo " check1=$check1 -> everything ok -> setting status..." >> $scriptlog 2>&1 ;; 83 1) echo " check1=$check1 -> everything ok -> setting status..." >> $scriptlog 2>&1 84 printprocesslog "INFO files available for sequence $sequence" 85 ;; 87 86 2) echo " check1=$check1 -> files not yet available -> continue..." >> $scriptlog 2>&1 87 printprocesslog "INFO files not yet available for sequence $sequence" 88 88 check="no" 89 89 ;; 90 90 0) echo " check1=$check1 -> no connection to db -> continue..." >> $scriptlog 2>&1 91 printprocesslog "WARN connection to DB failed" 91 92 check="no" 92 93 ;; 93 *) echo "check1=$check1 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1 94 *) echo " check1=$check1 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1 95 printprocesslog "ERROR $program.C failed" 94 96 com=$Ffilesavail 95 97 check=$check1 -
trunk/MagicSoft/Mars/datacenter/scripts/checkstardone
r7938 r7944 36 36 # 37 37 38 source `dirname $0`/sourcefile 39 printprocesslog "INFO starting $0" 38 40 program=checkstardone 39 source `dirname $0`/sourcefile40 41 41 column=fStarFilesAvail 42 42 43 lockfile=$lockpath/lock-$program.txt 44 45 scriptlogpath=$runlogpath/$program 46 makedir $scriptlogpath 47 scriptlog=$scriptlogpath/$program-$datetime.log 48 43 scriptlog=$runlogpath/$program-$datetime.log 49 44 date >> $scriptlog 2>&1 50 45 51 46 # check if script is already running 47 lockfile=$lockpath/lock-$program.txt 52 48 checklock >> $scriptlog 2>&1 53 49 … … 61 57 finish >> $scriptlog 2>&1 62 58 fi 63 echo "datasets: "${datasets[@]} #>> $scriptlog 2>&159 echo "datasets: "${datasets[@]} >> $scriptlog 2>&1 64 60 rm -v $todofile >> $scriptlog 2>&1 65 61 … … 68 64 for dataset in ${datasets[@]} 69 65 do 66 echo "checking files for dataset $dataset..." >> $scriptlog 2>&1 67 printprocesslog "INFO checking files for dataset $dataset" 70 68 no=`printf %08d $dataset | cut -c 0-5` 71 69 no2=`printf %08d $dataset` 72 70 var1=$no 73 71 var2=$dataset 74 echo "checking files for dataset $dataset..." >> $scriptlog 2>&175 72 datasetfile=$datasetpath/$no/dataset`printf %08d $dataset`.txt 73 76 74 sequences=(`cat $datasetfile | grep Sequences | sed -e 's/SequencesOn://g' | sed -e 's/SequencesOff://g'`) 77 78 75 if [ "$sequences" = "" ] 79 76 then … … 82 79 continue 83 80 fi 81 echo "sequences: "${sequences[@]} >> $scriptlog 2>&1 84 82 85 echo "sequences: "${sequences[@]} >> $scriptlog 2>&186 87 83 outpath=$logpath/$program/$no/$no2 88 84 makedir $outpath >> $scriptlog 2>&1 … … 93 89 do 94 90 echo "run $program for sequence $sequence..." >> $scriptlog 2>&1 91 printprocesslog "INFO check availability for sequence $sequence" 95 92 96 93 check1=`root -q -b $macrospath/checkstardone.C+\(\""$sequence\""\) | tee $outpath/checkstardone-$sequence.log | grep int | sed -e 's/(int)//'` … … 99 96 1) echo " check1=$check1 -> everything ok -> continue with next sequence..." >> $scriptlog 2>&1 ;; 100 97 2) echo " check1=$check1 -> files for sequence $sequence not yet available -> continue..." >> $scriptlog 2>&1 98 printprocesslog "INFO files not yet available for sequence $sequence" 101 99 check="no" 102 100 break 103 101 ;; 104 102 0) echo " check1=$check1 -> no connection to db -> continue..." >> $scriptlog 2>&1 103 printprocesslog "WARN connection to DB failed" 105 104 check="no" 106 105 break 107 106 ;; 108 107 *) echo " check1=$check1 -> ERROR " >> $scriptlog 2>&1 108 printprocesslog "ERROR $program.C failed" 109 109 com=$Fstardone 110 110 comadd=$sequence -
trunk/MagicSoft/Mars/datacenter/scripts/copyscript
r7938 r7944 57 57 # 58 58 59 source `dirname $0`/sourcefile 60 printprocesslog "INFO starting $0" 59 61 program=copyscript 60 source `dirname $0`/sourcefile61 62 62 63 set -C … … 67 68 char=24 68 69 datetime=`date +%F-%H-%M-%S` 69 lockfile=$lockpath/lock-copyscript.txt 70 71 scriptlogpath=$runlogpath/$program 72 makedir $scriptlogpath 73 74 scriptlog=$scriptlogpath/copyscript-$datetime.log 75 70 lockfile=$lockpath/lock-$program.txt 71 72 scriptlog=$runlogpath/$program-$datetime.log 76 73 date >> $scriptlog 2>&1 77 74 … … 87 84 then 88 85 echo "couldn't create checkfile -> exit script" >> $scriptlog 2>&1 89 rm -v $lockfile >> $scriptlog 2>&1 90 date >> $scriptlog 2>&1 91 exit 86 finish >> $scriptlog 2>&1 92 87 else 93 88 echo "checkfile created" >> $scriptlog 2>&1 … … 109 104 then 110 105 echo "nothing to do -> exit" >> $scriptlog 2>&1 111 rm -v $lockfile >> $scriptlog 2>&1 112 date >> $scriptlog 2>&1 113 exit 106 finish >> $scriptlog 2>&1 114 107 fi 115 108 … … 118 111 for date in ${dates[@]} 119 112 do 113 printprocesslog "INFO processing files for $date" 120 114 #find all files for this date 121 115 files=`find $transdir/*/$date/ -name "*.*"` >> $scriptlog 2>&1 … … 129 123 130 124 date2=`echo $date | sed -e 's/_/\//g'` 131 copylogpath=$logpath/ copyscript/$date2125 copylogpath=$logpath/$program/$date2 132 126 echo "copylogpath: "$copylogpath >> $scriptlog 2>&1 133 127 makedir $copylogpath >> $scriptlog 2>&1 … … 155 149 checkfillrbk=`root -q -b $macrospath/filldotrbk.C+\("\"$file\""\,kFALSE\) | tee $copylogpath/filldotrbk-$filename-log.txt | grep int | sed -e 's/(int)//'` 156 150 case $checkfillrbk in 157 1) echo "checkfillrbk=$checkfillrbk -> everything ok " >> $scriptlog 2>&1 158 echo " -> go on with copying file" >> $scriptlog 2>&1 ;; 159 *) echo "checkfillrbk=$checkfillrbk - Error -> go on with next file" >> $scriptlog 2>&1 160 continue;; 151 1) echo " checkfillrbk=$checkfillrbk -> everything ok " >> $scriptlog 2>&1 152 echo " -> go on with copying file" >> $scriptlog 2>&1 153 ;; 154 *) echo " checkfillrbk=$checkfillrbk - Error -> go on with next file" >> $scriptlog 2>&1 155 printprocesslog "ERROR filldotrbk.C failed for $file" 156 continue 157 ;; 161 158 esac 162 159 fi … … 166 163 checkfillrun=`root -q -b $macrospath/filldotrun.C+\("\"$file\""\,kFALSE\) | tee $copylogpath/filldotrun-$filename-log.txt | grep int | sed -e 's/(int)//'` 167 164 case $checkfillrun in 168 1) echo " checkfillrun=$checkfillrun -> everything ok " >> $scriptlog 2>&1169 echo " -> insert date in SequenceBuildStatus for $date" >> $scriptlog 2>&1165 1) echo " checkfillrun=$checkfillrun -> everything ok " >> $scriptlog 2>&1 166 echo " -> insert date in SequenceBuildStatus for $date" >> $scriptlog 2>&1 170 167 171 168 checkinsertdate=`root -q -b $macrospath/insertdate.C+\("\"$date\""\) | tee $copylogpath/insertdate-$date-log.txt | grep int | sed -e 's/(int)//'` 172 169 case $checkinsertdate in 173 170 1) echo "date inserted" >> $scriptlog 2>&1 ;; 174 *) echo "checkinsertdate=$checkinsertdate -> ERROR - insert date didn't work" >> $scriptlog 2>&1 175 continue;; 171 *) echo " checkinsertdate=$checkinsertdate -> ERROR - insert date didn't work" >> $scriptlog 2>&1 172 printprocesslog "ERROR insertdate.C failed for $date" 173 continue 174 ;; 176 175 esac 177 echo " -> go on with copying file" >> $scriptlog 2>&1 ;; 178 *) echo "checkfillrun=$checkfillrun Error -> go on with next file" >> $scriptlog 2>&1 179 continue;; 176 echo " -> go on with copying file" >> $scriptlog 2>&1 177 ;; 178 *) echo " checkfillrun=$checkfillrun Error -> go on with next file" >> $scriptlog 2>&1 179 printprocesslog "ERROR filldotrun.C failed for $file" 180 continue 181 ;; 180 182 esac 181 183 fi … … 189 191 else 190 192 echo $file" couldn't be moved!!!!!" >> $scriptlog 2>&1 193 printprocesslog "WARN moving of file $file didn't work" 191 194 fi 192 195 … … 195 198 #already processed (entry in donelist) -> go on with next file 196 199 echo $file": checksum not ok " >> $scriptlog 2>&1 200 printprocesslog "WARN checksum for file $file is not ok" 197 201 fi 198 202 done … … 208 212 #second part of the script: 209 213 #update the catalog file magic_favorites.edb 210 214 printprocesslog "INFO processing new catalog files" 211 215 magfav=magic_favorites.edb #catalog filename 212 216 catalog=$setuppath/$magfav #current catalogfile … … 218 222 for catfile in ${catfiles[@]} 219 223 do 224 printprocesslog "INFO processing catalog file $catfile" 220 225 #write information into .diff 221 226 echo "diff $catfile $catalog" >| $diff … … 240 245 #inform $adrs about removed lines 241 246 nail -s 'catalogfile - removed lines' $adrs < $diff 242 exit 247 printprocesslog "NEWS catalog file: lines have been removed ($catfile)" 248 finish >> $scriptlog 2>&1 243 249 fi 244 250 … … 252 258 then 253 259 echo "could not do 'rsync -av $catalog $setuppath/oldcatalogs/$magfav.$date' -> exit" >> $scriptlog 2>&1 254 exit 260 printprocesslog "ERROR rsync of catalog file ($catalog -> $oldcatalogpath/$magfav.$date) didn't work" 261 finish >> $scriptlog 2>&1 255 262 fi 256 263 #rsync new catalogfile to current catalogfile … … 258 265 then 259 266 echo "could not do 'rsync -av $catfile $catalog' -> exit" >> $scriptlog 2>&1 260 exit 267 printprocesslog "ERROR rsync of catalog file ($catfile -> $catalog) didn't work" 268 finish >> $scriptlog 2>&1 261 269 fi 262 270 #inform $adrs about changes 263 271 echo "file has been rsynced sucessfully -> sending email" >> $scriptlog 2>&1 264 272 nail -s 'new catalogfile installed - new lines' $adrs < $diff 273 printprocesslog "NEWS there are new lines in the catalogfile (see $catalog)" 265 274 continue 266 275 fi … … 273 282 #inform $adrs about removed lines 274 283 nail -s 'catalogfile - removed lines' $adrs < $diff 275 exit 284 printprocesslog "NEWS catalog file: lines have been removed ($catfile)" 285 finish >> $scriptlog 2>&1 276 286 fi 277 287 # echo "nothing has changed ($catfile)" >> $scriptlog 2>&1 278 288 done 279 289 280 281 rm -v $lockfile >> $scriptlog 2>&1 282 date >> $scriptlog 2>&1 283 284 set +C 290 finish >> $scriptlog 2>&1 291 -
trunk/MagicSoft/Mars/datacenter/scripts/correcttime
r7938 r7944 37 37 # 38 38 39 source `dirname $0`/sourcefile 40 printprocesslog "INFO starting $0" 39 41 program=correct_raw_time 40 source `dirname $0`/sourcefile41 42 42 column=fTimingCorrection 43 43 44 lockfile=$lockpath/lock-$program.txt 45 scriptlogpath=$runlogpath/$program 44 scriptlog=$runlogpath/$program-$datetime.log 45 date >> $scriptlog 2>&1 46 46 47 47 if [ -e $todofile ] 48 48 then 49 echo "$program is already running -> exit" 49 echo "$program is already running -> exit" >> $scriptlog 2>&1 50 50 exit 51 51 fi … … 58 58 if [ "$runs" = "" ] 59 59 then 60 echo "nothing to do -> exit" 60 echo "nothing to do -> exit" >> $scriptlog 2>&1 61 61 finish >> $scriptlog 2>&1 62 62 fi 63 echo "runs: "${runs[@]} 64 rm -v $todofile >> $scriptlog 2>&1 63 echo "runs: "${runs[@]} >> $scriptlog 2>&1 65 64 66 65 cd $mars … … 68 67 for run in ${runs[@]} 69 68 do 70 no=`printf %08d $run | cut -c 1-5` 71 var1=$no 72 var2=$run 73 echo "getting path for run $run ... " 74 infile=`find $datapath/rawfiles-wrong-timing/ -name *${run}_[D,C,P,S]_*` 75 echo "infile:"$infile 76 outfile=`echo $infile | sed -e 's/-wrong-timing//g'` 77 echo "outfile:"$outfile 78 outpath=`dirname $outfile` 79 echo "outpath:"$outpath 80 makedir $outpath 69 printprocesslog "INFO run correct_raw_time for run $run" 70 no=`printf %08d $run | cut -c 1-5` 71 var1=$no 72 var2=$run 73 echo "getting path for run $run ... " >> $scriptlog 2>&1 74 infile=`find $datapath/rawfiles-wrong-timing/ -name *${run}_[D,C,P,S]_*` 75 echo "infile:"$infile >> $scriptlog 2>&1 76 outfile=`echo $infile | sed -e 's/-wrong-timing//g'` 77 echo "outfile:"$outfile >> $scriptlog 2>&1 78 outpath=`dirname $outfile` 79 echo "outpath:"$outpath >> $scriptlog 2>&1 80 makedir $outpath >> $scriptlog 2>&1 81 81 82 timecorrpath=$outpath"/timecorrlogs" 83 echo "timecorrpath: "$timecorrpath 84 makedir $timecorrpath 85 86 check1=0 87 echo "run $program..." >> $scriptlog 2>&1 88 setstatus "start" >> $scriptlog 2>&1 82 timecorrpath=$outpath"/timecorrlogs" 83 echo "timecorrpath: "$timecorrpath >> $scriptlog 2>&1 84 makedir $timecorrpath >> $scriptlog 2>&1 89 85 90 /home/tape/MagicReadout/correct_raw_time $infile $outfile > $timecorrpath/$program-$run.log 91 check1=$? 86 check1=0 87 echo "run $program..." >> $scriptlog 2>&1 88 setstatus "start" >> $scriptlog 2>&1 92 89 93 case $check1 in 94 1) echo "check1=$check1 -> everything ok -> setting status..." >> $scriptlog 2>&1 ;; 95 *) echo "check1=$check1 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1 96 com=$Ftimecorr 97 check=$check1 98 ;; 99 esac 100 echo "inserting the status for $program for run $run into the db" >> $scriptlog 2>&1 101 setstatus "stop" >> $scriptlog 2>&1 90 /home/tape/MagicReadout/correct_raw_time $infile $outfile > $timecorrpath/$program-$run.log 91 check1=$? 92 93 case $check1 in 94 1) echo " check1=$check1 -> everything ok -> setting status..." >> $scriptlog 2>&1 ;; 95 *) echo " check1=$check1 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1 96 printprocesslog "ERROR $program failed" 97 com=$Ftimecorr 98 check=$check1 99 ;; 100 esac 101 102 setstatus "stop" >> $scriptlog 2>&1 102 103 done 103 104 -
trunk/MagicSoft/Mars/datacenter/scripts/dodatacheck
r7938 r7944 40 40 41 41 source `dirname $0`/sourcefile 42 printprocesslog "INFO starting $0" 42 43 program=datacheck 43 44 column=fDataCheckDone … … 45 46 set -C 46 47 47 scriptlogpath=$runlogpath/$program 48 makedir $scriptlogpath 49 scriptlog=$scriptlogpath/$program-$datetime.log 50 48 scriptlog=$runlogpath/$program-$datetime.log 51 49 date >> $scriptlog 2>&1 52 50 … … 62 60 63 61 echo "do $program for run "$run >> $scriptlog 2>&1 62 printprocesslog "INFO do $program for run $run" 64 63 no=`printf %08d $run | cut -c 0-2` 65 64 no2=`printf %08d $run` … … 84 83 case $check1 in 85 84 1) echo " check1=$check1 -> everything ok -> go on with $program..." >> $scriptlog 2>&1 85 printprocesslog "INFO finished filldotraw.C sucessfully for $rawfile" 86 86 ;; 87 87 0) echo " check1=$check1 -> no connection to db -> continue..." >> $scriptlog 2>&1 88 printprocesslog "WARN connection to DB failed" 88 89 check="no" 89 90 setstatus "stop" >> $scriptlog 2>&1 90 91 continue ;; 91 92 *) echo " check1=$check1 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1 93 printprocesslog "ERROR filldotraw.C failed for $rawfile" 92 94 com=$Ffillraw 93 95 check=$check1 … … 97 99 98 100 # running sinope 101 printprocesslog "INFO running sinope for $run" 99 102 sinopepath=$datapath/sinope/$date 100 103 makedir $sinopepath >> $scriptlog 2>&1 … … 113 116 ;; 114 117 *) echo " check2=$check2 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1 118 printprocesslog "ERROR sinope $sin failed for $rawfile" 115 119 com=$Fsinope 116 120 # comadd= … … 132 136 case $check3 in 133 137 1) echo " check3=$check3 -> everything ok -> set status..." >> $scriptlog 2>&1 138 printprocesslog "INFO finished fillsinope.C sucessfully for run $run" 134 139 ;; 135 140 0) echo " check3=$check3 -> no connection to db -> continue..." >> $scriptlog 2>&1 141 printprocesslog "WARN connection to DB failed" 136 142 check="no" 137 143 setstatus "stop" >> $scriptlog 2>&1 138 144 continue ;; 139 145 *) echo " check3=$check3 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1 146 printprocesslog "ERROR fillsinope.C failed for run $run" 140 147 com=$Ffillsinope 141 148 check=$check3 … … 146 153 # resetting the status for exclusions 147 154 echo "resetting the status for fExclusionsDone for date $date2" >> $scriptlog 2>&1 155 printprocesslog "INFO resetting fExclusions done for $date2" 148 156 resetlogpath=$logpath/resetexclusions/$date 149 157 makedir $resetlogpath >> $scriptlog 2>&1 … … 153 161 case $check5 in 154 162 1) echo " check5=$check5 -> everything ok, fExclusions have been reset " >> $scriptlog 2>&1 163 printprocesslog "INFO resetted fExclusions done for $date2 successfully" 155 164 ;; 156 165 0) echo " check5=$check5 -> no connection to db -> continue..." >> $scriptlog 2>&1 166 printprocesslog "WARN connection to DB failed" 157 167 check="no" 158 168 setstatus "stop" >> $scriptlog 2>&1 159 169 continue ;; 160 170 *) echo " check5=$check5 -> ERROR -> step could not be resetted -> repeat step " >> $scriptlog 2>&1 171 printprocesslog "ERROR resetcolumn.C failed for date $date2" 161 172 com=$Fresetexcl 162 173 comadd=`echo $date2 | sed -e 's/-//g'` -
trunk/MagicSoft/Mars/datacenter/scripts/doexclusions
r7938 r7944 35 35 # 36 36 37 source `dirname $0`/sourcefile 38 printprocesslog "INFO starting $0" 37 39 program=doexclusions 38 source `dirname $0`/sourcefile40 column=fExclusionsDone 39 41 40 42 set -C 41 43 42 column=fExclusionsDone 43 44 lockfile=$lockpath/lock-$program.txt 45 46 scriptlogpath=$runlogpath/$program 47 makedir $scriptlogpath 48 scriptlog=$scriptlogpath/$program-$datetime.log 49 44 scriptlog=$runlogpath/$program-$datetime.log 50 45 date >> $scriptlog 2>&1 51 46 52 47 # check if the script is already running 48 lockfile=$lockpath/lock-$program.txt 53 49 checklock >> $scriptlog 2>&1 54 50 … … 71 67 do 72 68 echo "do exclusions for date "$date >> $scriptlog 2>&1 69 printprocesslog "INFO do exclusions for $date" 73 70 year2=`echo $date | cut -c 1-4` 74 71 var1=$year2 … … 83 80 84 81 case $check1 in 85 1) echo " check1=$check1 -> everything ok -> setting status..." >> $scriptlog 2>&1 ;; 82 1) echo " check1=$check1 -> everything ok -> setting status..." >> $scriptlog 2>&1 83 printprocesslog "INFO exclusions successfully done for $date" 84 ;; 85 0) echo " check1=$check1 -> no connection to db -> continue..." >> $scriptlog 2>&1 86 printprocesslog "WARN connection to DB failed" 87 check="no" 88 ;; 86 89 *) echo " check1=$check1 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1 90 printprocesslog "ERROR $program.C failed" 87 91 com=$Fdoexcl 88 92 check=$check1 -
trunk/MagicSoft/Mars/datacenter/scripts/doqualityplots
r7938 r7944 33 33 # 34 34 35 source `dirname $0`/sourcefile 36 printprocesslog "INFO starting $0" 35 37 program=doqualityplots 36 source `dirname $0`/sourcefile37 38 38 39 set -C … … 40 41 cd $mars 41 42 42 datetime=`date +%F-%H-%M-%S` 43 44 scriptlogpath=$runlogpath/$program 45 makedir $scriptlogpath 46 47 scriptlog=$scriptlogpath/doqualityplots-$datetime.log 48 43 scriptlog=$runlogpath/$program-$datetime.log 49 44 date >> $scriptlog 2>&1 50 45 51 46 # check if script is already running 52 lockfile=$lockpath/lock- doqualityplots.txt47 lockfile=$lockpath/lock-$program.txt 53 48 checklock >> $scriptlog 2>&1 54 49 55 50 # producing the plots with the values from the database 56 51 echo "producing plots: " >> $scriptlog 2>&1 52 printprocesslog "INFO producing data quality plots" 57 53 check0=`root -q -b $macrospath/plotdb.C+\(\) | tee -a $scriptlog | grep int | sed -e 's/.*(int)//'` 58 54 59 55 case $check0 in 60 1) echo "check0=$check0 -> everything ok -> move files" >> $scriptlog 2>&1;; 61 *) echo "check0=$check0 -> ERROR -> couldn't create plots -> exit" >> $scriptlog 2>&1 62 rm -v $lockfile >> $scriptlog 2>&1 63 exit;; 56 1) echo " check0=$check0 -> everything ok -> move files" >> $scriptlog 2>&1 57 printprocesslog "INFO plots successfully produced" 58 ;; 59 *) echo " check0=$check0 -> ERROR -> couldn't create plots -> exit" >> $scriptlog 2>&1 60 printprocesslog "ERROR producing plots failed" 61 finish >> $scriptlog 2>&1 62 ;; 64 63 esac 65 64 66 65 # making files available in the web 66 printprocesslog "INFO moving files to web" 67 67 webpath=/www/htdocs/datacenter/datacheck 68 68 name=plotdb … … 84 84 # second part 85 85 # making plots for all datasets 86 printprocesslog "INFO producing plots for datasets" 86 87 datasets=`find $datapath/ganymed -name ganymed*.root | grep -v summary` 87 88 88 89 for dataset in ${datasets[@]} 89 90 do 91 printprocesslog "INFO producing plots for dataset $dataset" 90 92 nr=`echo $dataset | cut -d/ -f6` 91 93 nr2=`echo $nr | cut -c 1-5` … … 97 99 rm -v $plotlog >> $scriptlog 2>&1 98 100 check1=`root -q -b $macrospath/plotdb.C+\("\"$datasetfile\""\) 2>>$plotlog | tee -a $scriptlog | grep int | sed -e 's/.*(int)//'` 99 echo " check1: "$check1 >> $scriptlog 2>&1101 echo " check1: "$check1 >> $scriptlog 2>&1 100 102 newpsfile=$outpath/plotdb$nr.ps 101 103 newrootfile=$outpath/plotdb$nr.root … … 106 108 done 107 109 108 rm -v $lockfile >> $scriptlog 2>&1 110 finish >> $scriptlog 2>&1 109 111 110 set +C111 112 date >> $scriptlog 2>&1113 -
trunk/MagicSoft/Mars/datacenter/scripts/dowebplots
r7938 r7944 32 32 # 33 33 34 source `dirname $0`/sourcefile 35 printprocesslog "INFO starting $0" 34 36 program=dowebplots 35 source `dirname $0`/sourcefile36 37 37 38 set -C 38 39 39 cd $mars 40 41 datetime=`date +%F-%H-%M-%S` 42 43 scriptlogpath=$runlogpath/$program 44 makedir $scriptlogpath 45 46 scriptlog=$scriptlogpath/dowebplots-$datetime.log 47 40 scriptlog=$runlogpath/$program-$datetime.log 48 41 date >> $scriptlog 2>&1 49 50 42 51 43 while getopts p: opts … … 65 57 echo "usage: $(basename $0) -p programname" >> $scriptlog 2>&1 66 58 date >> $scriptlog 2>&1 59 printprocesslog "INFO finished $0" 67 60 exit 68 61 fi 69 62 70 63 # check if script is already running 71 lockfile=$lockpath/lock- dowebplots-$type.txt64 lockfile=$lockpath/lock-$program-$type.txt 72 65 checklock >> $scriptlog 2>&1 73 74 66 75 67 #finding all rootfiles in the data directory, that were modified in the last 3 days … … 81 73 then 82 74 echo "nothing to do -> exit" >> $scriptlog 2>&1 83 rm -v $lockfile >> $scriptlog 2>&1 84 date >> $scriptlog 2>&1 85 exit 75 finish >> $scriptlog 2>&1 86 76 fi 87 77 88 78 79 cd $mars 80 89 81 #produce plots for each rootfile 82 printprocesslog "INFO procduing plots for each $type rootfile" 90 83 for rootfile in ${rootfiles[@]} 91 84 do … … 120 113 fi 121 114 115 printprocesslog "INFO procduing plots for $rootfile" 122 116 echo "producing psfile..." >> $scriptlog 2>&1 123 117 ./showplot -b --save-as-ps=$psfile $rootfile >> $scriptlog 2>&1 … … 135 129 done 136 130 137 rm -v $lockfile >> $scriptlog 2>&1 131 finish >> $scriptlog 2>&1 138 132 139 set +C140 141 date >> $scriptlog 2>&1142 -
trunk/MagicSoft/Mars/datacenter/scripts/filesondisk
r7938 r7944 46 46 47 47 source `dirname $0`/sourcefile 48 printprocesslog "INFO starting $0" 49 program=filesondisk 48 50 49 51 set -C 50 52 51 cd $mars 52 53 program=filesondisk 54 55 lockfile=$lockpath/lock-$program.txt 56 57 scriptlogpath=$runlogpath/$program 58 makedir $scriptlogpath 59 scriptlog=$scriptlogpath/$program-$datetime.log 60 53 scriptlog=$runlogpath/$program-$datetime.log 61 54 date >> $scriptlog 2>&1 62 55 63 56 # check if script is already running 57 lockfile=$lockpath/lock-$program.txt 64 58 checklock >> $scriptlog 2>&1 65 59 66 date=`date +%F` 60 filesondisklogpath=$logpath/$program/`date +%Y/%m` 61 makedir $filesondisklogpath >> $scriptlog 2>&1 67 62 68 subsystemdir=/magic/subsystemdata 69 filesondisklogpath=$logpath/$program/`date +%Y/%m` 70 makedir $filesondisklogpath 71 63 cd $mars 72 64 73 65 echo "checking disk for ccfiles..." >> $scriptlog 2>&1 66 printprocesslog "INFO checking ccfiles" 74 67 filename=$filesondisklogpath/ccfilesondisk-$datetime.txt 75 68 column=fCCFileAvail 76 find $subsystem dir/cc/ -name '*_S.rep' | cut -d_ -f2 > $filename69 find $subsystempath/cc/ -name '*_S.rep' | cut -d_ -f2 > $filename 77 70 78 71 echo "resetting runs..." >> $scriptlog 2>&1 … … 80 73 81 74 case $check3 in 82 1) echo "check3=$check3 -> everything ok -> reset is done" >> $scriptlog 2>&1 ;; 83 *) echo "check3=$check3 -> ERROR -> something went wrong while resetting" >> $scriptlog 2>&1 ;; 75 1) echo " check3=$check3 -> everything ok -> reset is done" >> $scriptlog 2>&1 76 printprocesslog "INFO ccfiles resetted successfully" 77 ;; 78 0) echo " check1=$check1 -> no connection to db -> continue..." >> $scriptlog 2>&1 79 printprocesslog "WARN connection to DB failed" 80 ;; 81 *) echo " check3=$check3 -> ERROR -> something went wrong while resetting" >> $scriptlog 2>&1 82 printprocesslog "ERROR resettallruns.C failed for ccfiles" 83 ;; 84 84 esac 85 85 86 86 87 87 echo "checking disk for cacofiles..." >> $scriptlog 2>&1 88 printprocesslog "INFO checking cacofiles" 88 89 filename=$filesondisklogpath/cacofilesondisk-$datetime.txt 89 90 column=fCaCoFileAvail 90 find $subsystem dir/caco/ -name '*.txt' | cut -d_ -f8 | grep [0-9] > $filename91 find $subsystempath/caco/ -name '*.txt' | cut -d_ -f8 | grep [0-9] > $filename 91 92 92 93 echo "resetting runs..." >> $scriptlog 2>&1 … … 94 95 95 96 case $check0 in 96 1) echo "check0=$check0 -> everything ok -> reset is done" >> $scriptlog 2>&1 ;; 97 *) echo "check0=$check0 -> ERROR -> something went wrong while resetting" >> $scriptlog 2>&1 ;; 97 1) echo " check0=$check0 -> everything ok -> reset is done" >> $scriptlog 2>&1 98 printprocesslog "INFO cacofiles resetted successfully" 99 ;; 100 0) echo " check1=$check1 -> no connection to db -> continue..." >> $scriptlog 2>&1 101 printprocesslog "WARN connection to DB failed" 102 ;; 103 *) echo " check0=$check0 -> ERROR -> something went wrong while resetting" >> $scriptlog 2>&1 104 printprocesslog "ERROR resettallruns.C failed for cacofiles" 105 ;; 98 106 esac 99 107 108 date=`date +%F` 100 109 echo "checking missing cacofiles..." >> $scriptlog 2>&1 110 printprocesslog "INFO checking missing cacofiles" 101 111 check1=`root -q -b $macrospath/findcacofiles.C+\("\"$date\""\,"\"$filesondisklogpath\""\) | tee $filesondisklogpath/findcacofiles-$datetime.log | grep int | sed -e 's/(int)//'` 102 112 103 113 case $check1 in 104 1) echo "check1=$check1 -> everything ok -> missing cacofiles are found" >> $scriptlog 2>&1 ;; 105 *) echo "check1=$check1 -> ERROR -> something went wrong while resetting" >> $scriptlog 2>&1 ;; 114 1) echo " check1=$check1 -> everything ok -> missing cacofiles are found" >> $scriptlog 2>&1 115 printprocesslog "INFO missing cacofiles found" 116 ;; 117 0) echo " check1=$check1 -> no connection to db -> continue..." >> $scriptlog 2>&1 118 printprocesslog "WARN connection to DB failed" 119 ;; 120 *) echo " check1=$check1 -> ERROR -> something went wrong while resetting" >> $scriptlog 2>&1 121 printprocesslog "ERROR findcacofiles.C failed" 122 ;; 106 123 esac 107 124 125 printprocesslog "INFO finding missing cacofiles" 108 126 missingcacoruns=(`cat $filesondisklogpath/findcacofiles-$date.txt`) 109 127 for missingcacorun in ${missingcacoruns[@]} … … 112 130 echo "missing cacofile for run "$runno >> $scriptlog 2>&1 113 131 echo "-> finding cacofile" >> $scriptlog 2>&1 114 ccfile=`find $subsystem dir/cc/ -name [2][0][0-2][0-9][0,1][0-9][0-3][0-9]_*${runno}_[P,D,C,S]_*_S.rep` 2>/dev/null132 ccfile=`find $subsystempath/cc/ -name [2][0][0-2][0-9][0,1][0-9][0-3][0-9]_*${runno}_[P,D,C,S]_*_S.rep` 2>/dev/null 115 133 echo " ccfile: "$ccfile >> $scriptlog 2>&1 116 134 if [ "$ccfile" = "" ] … … 129 147 continue 130 148 else 149 printprocesslog "INFO inserting cacofile for run $missingcacorun" 131 150 echo " inserting cacofile $file for run $missingcacorun..." >> $scriptlog 2>&1 132 151 check2=`root -q -b $macrospath/insertcacofile.C+\("\"$runno\""\,"\"$newrun\""\) | tee $filesondisklogpath/insertcacofile-$missingcacorun.log | grep int | sed -e 's/(int)//'` 133 152 134 153 case $check2 in 135 1) echo " check2=$check2 -> everything ok -> insert is done" >> $scriptlog 2>&1 ;; 136 *) echo " check2=$check2 -> ERROR -> something went wrong while inserting run "$missingcacorun >> $scriptlog 2>&1 ;; 154 1) echo " check2=$check2 -> everything ok -> insert is done" >> $scriptlog 2>&1 155 printprocesslog "INFO inserted $missingcacorun successfully" 156 ;; 157 0) echo " check1=$check1 -> no connection to db -> continue..." >> $scriptlog 2>&1 158 printprocesslog "WARN connection to DB failed" 159 ;; 160 *) echo " check2=$check2 -> ERROR -> something went wrong while inserting run "$missingcacorun >> $scriptlog 2>&1 161 printprocesslog "ERROR insertcacofile.C failed for run $missingcacorun" 162 ;; 137 163 esac 138 164 break … … 142 168 then 143 169 echo " no cacofile found for run "$runno >> $scriptlog 2>&1 170 printprocesslog "WARN no cacofile found for run $runno" 144 171 else 145 172 echo " cacofile: "$cacofile >> $scriptlog 2>&1 … … 149 176 150 177 echo "checking disk for rawfiles..." >> $scriptlog 2>&1 178 printprocesslog "INFO checking rawfiles" 151 179 filename=$filesondisklogpath/rawfilesondisk-$datetime.txt 152 180 column=fRawFileAvail 153 find $datapath -name '*.raw' -o -name '*.gz' | cut -d_ -f2 > $filename181 find $datapath/rawfiles -name '*.raw' -o -name '*.gz' | cut -d_ -f2 > $filename 154 182 155 183 echo "resetting runs..." >> $scriptlog 2>&1 … … 157 185 158 186 case $check4 in 159 1) echo "check4=$check4 -> everything ok -> reset is done" >> $scriptlog 2>&1 ;; 160 *) echo "check4=$check4 -> ERROR -> something went wrong while resetting" >> $scriptlog 2>&1 ;; 187 1) echo " check4=$check4 -> everything ok -> reset is done" >> $scriptlog 2>&1 188 printprocesslog "INFO rawfiles resetted successfully" 189 ;; 190 0) echo " check1=$check1 -> no connection to db -> continue..." >> $scriptlog 2>&1 191 printprocesslog "WARN connection to DB failed" 192 ;; 193 *) echo " check4=$check4 -> ERROR -> something went wrong while resetting" >> $scriptlog 2>&1 194 printprocesslog "ERROR resettallruns.C failed for rawfiles" 195 ;; 161 196 esac 162 197 163 198 finish >> $scriptlog 2>&1 164 199 165 -
trunk/MagicSoft/Mars/datacenter/scripts/fillcallisto
r7938 r7944 36 36 # 37 37 38 source `dirname $0`/sourcefile 39 printprocesslog "INFO starting $0" 38 40 program=fillcallisto 39 source `dirname $0`/sourcefile 41 column=fFillCallisto 40 42 41 43 set -C 42 44 43 column=fFillCallisto 44 45 lockfile=$lockpath/lock-$program.txt 46 47 scriptlogpath=$runlogpath/$program 48 makedir $scriptlogpath 49 scriptlog=$scriptlogpath/run$program-$datetime.log 50 45 scriptlog=$runlogpath/run$program-$datetime.log 51 46 date >> $scriptlog 2>&1 52 47 53 48 # check if the script is already running 49 lockfile=$lockpath/lock-$program.txt 54 50 checklock >> $scriptlog 2>&1 55 51 … … 71 67 for sequence in ${sequences[@]} 72 68 do 69 printprocesslog "INFO starting $program for sequence $sequence" 73 70 no=`printf %08d $sequence | cut -c 0-4` 74 71 no2=`printf %08d $sequence` … … 86 83 setstatus "start" >> $scriptlog 2>&1 87 84 echo "run fillcalib..." >> $scriptlog 2>&1 85 printprocesslog "INFO starting fillcalib for sequence $sequence" 88 86 89 87 check1=`root -q -b $macrospath/fillcalib.C+\("\"$calibfile\""\,kFALSE\) | tee $fillcaliblog | grep int | sed -e 's/(int)//'` 90 88 91 89 case $check1 in 92 1) echo " check1=$check1 -> everything ok -> run fillsignal " >> $scriptlog 2>&1 ;; 90 1) echo " check1=$check1 -> everything ok -> run fillsignal " >> $scriptlog 2>&1 91 printprocesslog "INFO done fillcalib successfully for sequence $sequence" 92 ;; 93 93 0) echo " check1=$check1 -> no connection to db -> continue..." >> $scriptlog 2>&1 94 printprocesslog "WARN connection to DB failed" 94 95 check="no" 95 96 setstatus "stop" >> $scriptlog 2>&1 96 97 continue ;; 97 98 *) echo " check1=$check1 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1 99 printprocesslog "ERROR fillcalib failed for sequence $sequence" 98 100 com=$Ffillcalib 99 101 check=$check1 … … 102 104 esac 103 105 106 printprocesslog "INFO starting fillsignal for sequence $sequence" 104 107 check2=`root -q -b $macrospath/fillsignal.C+\("\"$signalfile\""\,kFALSE\) | tee $fillsignallog | grep int | sed -e 's/(int)//'` 105 108 case $check2 in 106 1) echo " check2=$check2 -> everything ok " >> $scriptlog 2>&1 ;; 109 1) echo " check2=$check2 -> everything ok " >> $scriptlog 2>&1 110 printprocesslog "INFO done fillsignal successfully for sequence $sequence" 111 ;; 107 112 0) echo " check2=$check2 -> no connection to db -> continue..." >> $scriptlog 2>&1 113 printprocesslog "WARN connection to DB failed" 108 114 check="no" 109 115 ;; 110 116 *) echo " check2=$check2 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1 117 printprocesslog "ERROR fillsignal failed for sequence $sequence" 111 118 com=$Ffillsignal 112 119 check=$check2 -
trunk/MagicSoft/Mars/datacenter/scripts/fillganymed
r7938 r7944 35 35 # 36 36 37 source `dirname $0`/sourcefile 38 printprocesslog "INFO starting $0" 37 39 program=fillganymed 38 source `dirname $0`/sourcefile 40 column=fFillGanymed 39 41 40 42 set -C 41 43 42 column=fFillGanymed 43 44 lockfile=$lockpath/lock-$program.txt 45 46 scriptlogpath=$runlogpath/$program 47 makedir $scriptlogpath 48 scriptlog=$scriptlogpath/run$program-$datetime.log 49 44 scriptlog=$runlogpath/run$program-$datetime.log 50 45 date >> $scriptlog 2>&1 51 46 52 47 # check if script is already running 48 lockfile=$lockpath/lock-$program.txt 53 49 checklock >> $scriptlog 2>&1 54 50 … … 71 67 for dataset in ${datasets[@]} 72 68 do 69 printprocesslog "INFO starting $program for dataset $dataset" 73 70 no=`printf %08d $dataset | cut -c 0-5` 74 71 no2=`printf %08d $dataset` … … 86 83 check2=`root -q -b $macrospath/fillganymed.C+\("\"$ganymedfile\""\,kFALSE\) | tee $fillganymedlog | grep int | sed -e 's/(int)//'` 87 84 case $check2 in 88 1) echo " check2=$check2 -> everything ok " >> $scriptlog 2>&1 ;; 85 1) echo " check2=$check2 -> everything ok " >> $scriptlog 2>&1 86 printprocesslog "INFO done fillganymed successfully for dataset $dataset" 87 ;; 89 88 0) echo " check2=$check2 -> no connection to db -> continue..." >> $scriptlog 2>&1 89 printprocesslog "WARN connection to DB failed" 90 90 check="no" 91 91 ;; 92 *) echo " check2=$check2 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1 93 com=$Ffillganymed 94 check=$check2 95 ;; 92 *) echo " check2=$check2 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1 93 printprocesslog "ERROR fillganymed failed for dataset $datset" 94 com=$Ffillganymed 95 check=$check2 96 ;; 96 97 esac 97 98 -
trunk/MagicSoft/Mars/datacenter/scripts/fillstar
r7938 r7944 35 35 # 36 36 37 source `dirname $0`/sourcefile 38 printprocesslog "INFO starting $0" 37 39 program=fillstar 38 source `dirname $0`/sourcefile 40 column=fFillStar 39 41 40 42 set -C 41 43 42 column=fFillStar 43 44 lockfile=$lockpath/lock-$program.txt 45 46 scriptlogpath=$runlogpath/$program 47 makedir $scriptlogpath 48 scriptlog=$scriptlogpath/run$program-$datetime.log 49 44 scriptlog=$runlogpath/run$program-$datetime.log 50 45 date >> $scriptlog 2>&1 51 46 52 47 # check if the script is already running 48 lockfile=$lockpath/lock-$program.txt 53 49 checklock >> $scriptlog 2>&1 54 50 55 51 # get todo list 56 52 getdolist >> $scriptlog 2>&1 57 58 53 59 54 # retrieve sequences from todo file … … 72 67 for sequence in ${sequences[@]} 73 68 do 69 printprocesslog "INFO starting $program for sequence $sequence" 74 70 no=`printf %08d $sequence | cut -c 0-4` 75 71 no2=`printf %08d $sequence` … … 87 83 check2=`root -q -b $macrospath/fillstar.C+\("\"$starfile\""\,kFALSE\) | tee $fillstarlog | grep \(int\) | sed -e 's/.*(int)//'` 88 84 case $check2 in 89 1) echo " check2=$check2 -> everything ok " >> $scriptlog 2>&1 ;; 85 1) echo " check2=$check2 -> everything ok " >> $scriptlog 2>&1 86 printprocesslog "INFO done fillstar successfully for sequence $sequence" 87 ;; 90 88 0) echo " check2=$check2 -> no connection to db -> continue..." >> $scriptlog 2>&1 89 printprocesslog "WARN connection to DB failed" 91 90 check="no" 92 91 ;; 93 92 *) echo " check2=$check2 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1 93 printprocesslog "ERROR fillstar failed for sequence $sequence" 94 94 com=$Ffillstar 95 95 check=$check2 -
trunk/MagicSoft/Mars/datacenter/scripts/insertdatasets
r7938 r7944 32 32 # 33 33 34 source `dirname $0`/sourcefile 35 printprocesslog "INFO starting $0" 34 36 program=insertdatasets 35 source `dirname $0`/sourcefile36 37 37 38 set -C 38 39 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 40 scriptlog=$runlogpath/$program-$datetime.log 49 41 date >> $scriptlog 2>&1 50 42 51 43 # check if script is already running 44 lockfile=$lockpath/lock-$program.txt 52 45 checklock >> $scriptlog 2>&1 53 46 … … 57 50 echo "" >> $scriptlog 2>&1 58 51 52 cd $mars 53 59 54 # extract information from dataset file and insert it into db with the macro insertdataset.C 55 printprocesslog "INFO inserting dataset information into db" 60 56 for datasetfile in ${datasetfiles[@]} 61 57 do … … 74 70 echo "number in filename and in file are not the same " >> $scriptlog 2>&1 75 71 echo " -> continue with next dataset" >> $scriptlog 2>&1 72 printprocesslog "ERROR number in filename and file are not the same for dataset $no2" 76 73 continue 77 74 fi … … 98 95 insertdatasetlog=$insertdatasetpath/insertdataset-$no3.log 99 96 97 printprocesslog "INFO inserting dataset $no2" 100 98 # insert information into db 101 99 check0=`root -q -b $macrospath/insertdataset.C+\("\"$no2\""\,"\"$source\""\,"\"$wobble\""\,"\"$comment\""\,kFALSE\) | tee $insertdatasetlog | grep int | sed -e 's/(int)//'` 102 100 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 ;; 105 111 esac 106 112 done 107 113 108 rm -v $lockfile >> $scriptlog 2>&1 114 finish >> $scriptlog 2>&1 109 115 110 set +C111 112 date >> $scriptlog 2>&1113 -
trunk/MagicSoft/Mars/datacenter/scripts/insertsequences
r7938 r7944 33 33 # 34 34 35 source `dirname $0`/sourcefile 36 printprocesslog "INFO starting $0" 35 37 program=insertsequences 36 source `dirname $0`/sourcefile37 38 38 39 set -C 39 40 40 cd $mars 41 42 datetime=`date +%F-%H-%M-%S` 43 year=`date +%Y` 44 lockfile=$lockpath/lock-insertsequences.txt 45 46 scriptlogpath=$runlogpath/$program 47 makedir $scriptlogpath 48 49 scriptlog=$scriptlogpath/insertsequences-$datetime.log 50 41 scriptlog=$runlogpath/$program-$datetime.log 51 42 date >> $scriptlog 2>&1 52 43 53 44 # check if script is already running 45 lockfile=$lockpath/lock-$program.txt 54 46 checklock >> $scriptlog 2>&1 55 47 … … 61 53 echo "" >> $scriptlog 2>&1 62 54 55 cd $mars 56 63 57 # process sequencefiles: insert information into the database 64 58 for sequencefile in ${sequencefiles[@]} 65 59 do 60 printprocesslog "INFO inserting sequence from file $sequencefile" 66 61 echo "file: "$sequencefile >> $scriptlog 2>&1 67 62 no=`echo $sequencefile | cut -c 31-38` 68 no =`echo $no | cut -c 1-4`69 insertsequencepath=$logpath/ insertsequence/$no63 no2=`echo $no | cut -c 1-4` 64 insertsequencepath=$logpath/$program/$no2 70 65 makedir $insertsequencepath >> $scriptlog 2>&1 71 insertsequencelog=$insertsequencepath/ insertsequence-$no.log66 insertsequencelog=$insertsequencepath/$program-$no.log 72 67 73 68 check0=`root -q -b $macrospath/insertsequence.C+\("\"$sequencefile\""\,kFALSE\) | tee $insertsequencelog | grep int | sed -e 's/(int)//'` 74 69 case $check0 in 75 1) echo "check0=$check0 -> everything ok " >> $scriptlog 2>&1 ;; 76 *) echo "check0=$check0 -> ERROR " >> $scriptlog 2>&1 ;; 70 1) echo "check0=$check0 -> everything ok " >> $scriptlog 2>&1 71 printprocesslog "INFO sequence $no2 successfully inserted" 72 ;; 73 0) echo " check1=$check1 -> no connection to db -> continue..." >> $scriptlog 2>&1 74 printprocesslog "WARN connection to DB failed" 75 check="no" 76 ;; 77 *) echo "check0=$check0 -> ERROR " >> $scriptlog 2>&1 78 printprocesslog "ERROR $program.C failed for sequence $no2" 79 ;; 77 80 esac 78 81 done 79 82 80 rm -v $lockpath/lock-insertsequences.txt >> $scriptlog 2>&1 83 finish >> $scriptlog 2>&1 81 84 82 set +C83 84 date >> $scriptlog 2>&185 -
trunk/MagicSoft/Mars/datacenter/scripts/jobmanager
r7936 r7944 31 31 32 32 source `dirname $0`/sourcefile 33 user=`whoami` 33 printprocesslog "INFO starting $0" 34 34 35 35 set -C … … 42 42 43 43 prev=$max 44 user=`whoami` 44 45 notcount=0 45 46 while (( $notcount < 100 )) … … 117 118 nail -s 'condor problem' $erradrs < $jmerrorlog 118 119 echo "condor is not working -> sleeping $errorsleeptime" >> $jmscriptlog 2>&1 120 printprocesslog "ERROR submitting ${scripts[$i]} to condor failed" 119 121 sleep $errorsleeptime 120 122 fi -
trunk/MagicSoft/Mars/datacenter/scripts/linkmc
r7938 r7944 42 42 # 43 43 44 source `dirname $0`/sourcefile 45 printprocesslog "INFO starting $0" 44 46 program=linkmc 45 source `dirname $0`/sourcefile46 47 47 48 set -C 48 49 49 scriptlogpath=$runlogpath/$program 50 makedir $scriptlogpath 51 scriptlog=$scriptlogpath/linkmc`date +%F`.log 52 50 scriptlog=$runlogpath/$progam-`date +%F`.log 53 51 date >> $scriptlog 2>&1 54 52 55 53 # check if script is already running 56 lockfile=$lockpath/lock- mclinks.txt54 lockfile=$lockpath/lock-$program.txt 57 55 checklock >> $scriptlog 2>&1 58 56 … … 67 65 then 68 66 echo "file $next not found -> no start-runno -> exit" >> $scriptlog 2>&1 69 rm -v $lockfile >> $scriptlog 2>&170 exit67 printprocesslog "ERROR file $next (last runno) not found" 68 finish >> $scriptlog 2>&1 71 69 fi 72 70 … … 116 114 camfiles=`find $mccampath -type f | grep -v Cal_and_Ped` 117 115 116 printprocesslog "INFO linking new camerafiles starting with runno $runno" 118 117 for camfile in ${camfiles[@]} 119 118 do … … 123 122 continue 124 123 fi 124 printprocesslog "INFO linking $file" 125 125 file=`basename $camfile` #filename 126 126 no=`printf %08d $runno | cut -c 0-5` #first 5 digits of a 8digit runno -> for path … … 177 177 done 178 178 179 printprocesslog "INFO linking cal and ped files" 179 180 echo "linking cal and ped file" >> $scriptlog 2>&1 180 181 #get files … … 188 189 then 189 190 "too many files in the directory $mccampath/Cal_and_Ped -> exit" >> $scriptlog 2>&1 190 rm -v $lockfile >> $scriptlog 2>&1191 exit191 printprocesslog "ERROR too many ped and cal files found in $mccampath/Cal_and_Ped" 192 finish >> $scriptlog 2>&1 192 193 fi 193 194 … … 225 226 done 226 227 227 rm -v $lockfile >> $scriptlog 2>&1 228 229 set +C 230 231 date >> $scriptlog 2>&1 232 228 finish >> $scriptlog 2>&1 229 -
trunk/MagicSoft/Mars/datacenter/scripts/makecallistolinks
r7938 r7944 33 33 # 34 34 35 source `dirname $0`/sourcefile 36 printprocesslog "INFO starting $0" 35 37 program=makecallistolinks 36 source `dirname $0`/sourcefile 38 column=fCallisto 37 39 38 40 set -C 39 41 40 callistorcseq=callisto.rc 41 callistorcnew=callisto_Dec04Jan05.rc 42 43 scriptlogpath=$runlogpath/$program 44 makedir $scriptlogpath 45 scriptlog=$scriptlogpath/$program`date +%F`.log 46 42 scriptlog=$runlogpath/$program`date +%F`.log 47 43 date >> $scriptlog 2>&1 48 44 … … 51 47 checklock >> $scriptlog 2>&1 52 48 49 callistorcseq=callisto.rc 50 callistorcnew=callisto_Dec04Jan05.rc 53 51 # reason why calibration with standard callisto.rc fails 54 52 reason1="Pulse is too much to the right, cannot go beyond logain limits!" … … 60 58 then 61 59 echo "nothing to do -> exit" >> $scriptlog 2>&1 62 rm -v $lockfile>> $scriptlog 2>&160 finish >> $scriptlog 2>&1 63 61 fi 64 65 column=fCallisto66 table=SequenceProcessStatus67 62 68 63 cd $mars 69 64 70 65 # make links for callisto.rc for which the callisto.log contains reason 66 printprocesslog "INFO linking callisto.rc files" 71 67 for file in $files 72 68 do … … 80 76 if ! ls -l $callistorc | grep $callistorcnew >> $scriptlog 2>&1 81 77 then 78 printprocesslog "INFO linking $callistorcnew to $callistorc for sequ $sequ" 82 79 # resetting the calibration 83 80 echo "resetting the callisto for sequence $sequ" >> $scriptlog 2>&1 … … 90 87 case $check1 in 91 88 1) echo " check1=$check1 -> everything ok, callisto has been reset " >> $scriptlog 2>&1 89 printprocesslog "INFO resetted calibration successfully for sequence $sequ" 90 ;; 91 0) echo " check1=$check1 -> no connection to db -> continue..." >> $scriptlog 2>&1 92 printprocesslog "WARN connection to DB failed" 93 check="no" 92 94 ;; 93 95 *) echo " check1=$check1 -> ERROR -> step could not be resetted -> continue " >> $scriptlog 2>&1 94 continue ;; 96 printprocesslog "ERROR resetcolumn.C failed for fCallisto for sequ $sequ" 97 continue 98 ;; 95 99 esac 96 100 #linking callisto.rc … … 100 104 done 101 105 102 rm -v $lockfile>> $scriptlog 2>&1106 finish >> $scriptlog 2>&1 103 107 104 set +C105 106 date >> $scriptlog 2>&1107 -
trunk/MagicSoft/Mars/datacenter/scripts/mcsequences
r7938 r7944 34 34 # 35 35 36 source `dirname $0`/sourcefile 37 printprocesslog "INFO starting $0" 36 38 program=mcsequences 37 source `dirname $0`/sourcefile38 39 39 40 set -C 40 41 41 scriptlogpath=$runlogpath/$program 42 makedir $scriptlogpath 43 scriptlog=$scriptlogpath/$program`date +%F`.log 44 42 scriptlog=$runlogpath/$program`date +%F`.log 45 43 date >> $scriptlog 2>&1 46 44 … … 49 47 checklock >> $scriptlog 2>&1 50 48 51 52 49 mcpath=/montecarlo/rawfiles 53 50 mcsequpath=/montecarlo/sequences 54 51 55 52 # find montecarlo directories, build one sequence per directory and write sequence file 53 printprocesslog "INFO building one sequence per mcdirectory" 56 54 dirs=`find $mcpath -type d` 57 55 for dir in ${dirs[@]} … … 83 81 sequfile=$sequpath/sequence$no2.txt 84 82 echo "writing sequfile "$sequfile >> $scriptlog 2>&1 83 printprocesslog "INFO writing sequencefile $sequfile" 85 84 86 85 echo "Sequence: $firstrun" > $sequfile … … 93 92 done 94 93 94 finish >> $scriptlog 2>&1 95 95 96 rm -v $lockfile >> $scriptlog 2>&197 98 set +C99 100 date >> $scriptlog 2>&1101 -
trunk/MagicSoft/Mars/datacenter/scripts/movingrawfiles
r7938 r7944 31 31 32 32 source `dirname $0`/sourcefile 33 printprocesslog "INFO starting $0" 34 program=movingrawfiles 33 35 34 36 set -C 37 umask 0002 35 38 36 program=movingrawfiles 37 38 lockfile=$lockpath/lock-$program.txt 39 40 scriptlogpath=$runlogpath/$program 41 makedir $scriptlogpath 42 scriptlog=$scriptlogpath/$program-$datetime.log 43 39 scriptlog=$runlogpath/$program-$datetime.log 44 40 date >> $scriptlog 2>&1 45 41 46 42 # check if script is already running 43 lockfile=$lockpath/lock-$program.txt 47 44 checklock >> $scriptlog 2>&1 48 49 50 umask 000251 45 52 46 # change permission for files … … 54 48 # output for chmod with -v or -c (only changes) 55 49 50 printprocesslog "INFO moving directories from fromlapalma to fromtape" 56 51 #find directories, which have to be copied 57 52 dirs=`ls /magic/datacenter/fromlapalma/RAWchk/*/*.finished | sed -e 's/RAWchk/RAW/g' | cut -d/ -f1-6` … … 74 69 fi 75 70 71 printprocesslog "INFO moving moving rawfiles to $datapath/rawfiles" 76 72 for rawfile in $rawfiles 77 73 do … … 87 83 rmdir -v /magic/datacenter/fromtape/rawdata/* >> $scriptlog 2>&1 88 84 85 printprocesslog "INFO launching filesondisk" 89 86 echo "launching filesondisk" >> $scriptlog 2>&1 90 87 $scriptspath/filesondisk& -
trunk/MagicSoft/Mars/datacenter/scripts/processmcsequences
r7938 r7944 32 32 # 33 33 34 source `dirname $0`/sourcefile 35 printprocesslog "INFO starting $0" 34 36 program=processmcsequences 35 source `dirname $0`/sourcefile36 37 37 38 set -C 38 39 39 scriptlogpath=$runlogpath/$program 40 makedir $scriptlogpath 41 scriptlog=$scriptlogpath/$program`date +%F-%H-%M-%S`.log 42 40 scriptlog=$runlogpath/$program`date +%F-%H-%M-%S`.log 43 41 date >> $scriptlog 2>&1 44 42 … … 56 54 57 55 # find montecarlo sequence files 56 printprocesslog "INFO processing mc sequences" 58 57 sequfiles=`find $mcsequpath -type f` 59 58 for sequfile in ${sequfiles[@]} … … 95 94 # if calibration worked -> run star for sequence 96 95 case $check1 in 97 0) echo "check1=$check1 -> everything ok..." >> $scriptlog 2>&1 96 0) echo " check1=$check1 -> everything ok..." >> $scriptlog 2>&1 97 printprocesslog "INFO calibrated mc sequende $sequno successfully" 98 98 touch $caloutpath/.done 99 99 rm $caloutpath/.doing … … 105 105 106 106 case $check2 in 107 0) echo "check2=$check2 -> everything ok..." >> $scriptlog 2>&1 107 0) echo " check2=$check2 -> everything ok..." >> $scriptlog 2>&1 108 printprocesslog "INFO run star successfully for mc sequende $sequno" 108 109 touch $imgoutpath/.done 109 110 ;; 110 *) echo "check2=$check2 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1 111 *) echo " check2=$check2 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1 112 printprocesslog "ERROR star failed for mc sequende $sequno" 111 113 ;; 112 114 esac 113 115 ;; 114 *) echo "check1=$check1 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1;; 116 *) echo " check1=$check1 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1 117 printprocesslog "ERROR callisto failed for mc sequende $sequno" 118 ;; 115 119 esac 116 120 done 117 121 118 rm -v $lockfile>> $scriptlog 2>&1122 finish >> $scriptlog 2>&1 119 123 120 set +C121 122 date >> $scriptlog 2>&1123 -
trunk/MagicSoft/Mars/datacenter/scripts/rmlocks
r7902 r7944 38 38 39 39 source `dirname $0`/sourcefile 40 printprocesslog "INFO starting $0" 40 41 41 42 files=`ls $lockpath/*` … … 49 50 if [ $compdate -gt $filedate ] 50 51 then 52 printprocesslog "INFO removing file $file" 51 53 rm -v $file 52 54 echo "date: "$filedate -
trunk/MagicSoft/Mars/datacenter/scripts/runcallisto
r7938 r7944 37 37 # 38 38 39 source `dirname $0`/sourcefile 40 printprocesslog "INFO starting $0" 39 41 program=callisto 40 source `dirname $0`/sourcefile 42 column=fCallisto 41 43 42 44 set -C 43 45 44 # define callisto.rc files 45 callistorcnew=$setuppath/$program/callisto.rc 46 callistorcmarapr05=$setuppath/$program/callisto_MarApr05.rc 47 48 column=fCallisto 49 #pno=500 # number of processes, i.e. number of todo-files 50 51 scriptlogpath=$runlogpath/$program 52 makedir $scriptlogpath 53 scriptlog=$scriptlogpath/run$program-$datetime.log 54 46 scriptlog=$runlogpath/run$program-$datetime.log 55 47 date >> $scriptlog 2>&1 56 48 … … 67 59 # run calibration for sequence 68 60 echo "run $program for sequence $sequence..." >> $scriptlog 2>&1 61 printprocesslog "INFO starting $program for sequence $sequence" 69 62 no=`printf %08d $sequence | cut -c 0-4` 70 63 no2=`printf %08d $sequence` … … 73 66 outpath="$datapath/$program/$no/$no2" 74 67 makedir $outpath >> $scriptlog 2>&1 75 76 68 sequfile="$sequpath/$no/sequence$no2.txt" 77 69 70 # define callisto.rc files 71 callistorcnew=$setuppath/$program/callisto.rc 72 callistorcmarapr05=$setuppath/$program/callisto_MarApr05.rc 78 73 # find callisto.rc file 79 74 if [ -e $outpath/callisto.rc ] … … 99 94 case $check1 in 100 95 0) echo " check1=$check1 -> everything ok -> doing update..." >> $scriptlog 2>&1 96 printprocesslog "INFO $program finished successfully for sequence $sequence" 101 97 # running merpp update if calibration worked 102 98 # finding files, which have to be updated … … 113 109 makedir $merpplogpath >> $scriptlog 2>&1 114 110 111 printprocesslog "INFO doing merppupdate for sequence $sequence" 115 112 # updated calibrated data files with the information from the cc and caco files 116 113 for calfile in ${calfiles[@]} … … 127 124 then 128 125 echo "no ccfile found for run "$runno >> $scriptlog 2>&1 126 printprocesslog "ERROR no ccfile found for $calfile" 129 127 com=$Fnoccfile 130 128 comadd=$runno … … 163 161 check2=$? 164 162 case $check2 in 165 0) echo " check2=$check2 -> everything ok, merppccupdate worked -> continue" >> $scriptlog 2>&1;; 166 *) echo " check2=$check2 -> ERROR -> merppccupdate failed" >> $scriptlog 2>&1 163 0) echo " check2=$check2 -> everything ok, merppccupdate worked -> continue" >> $scriptlog 2>&1 164 printprocesslog "INFO merppupdated $calfile sucessfully with $ccfile" 165 ;; 166 *) echo " check2=$check2 -> ERROR -> merppccupdate failed" >> $scriptlog 2>&1 167 printprocesslog "ERROR merppccupdate failed for $calfile" 167 168 com=$Fmerppcc 168 169 comadd=$runno … … 173 174 check3=$? 174 175 case $check3 in 175 0) echo " check3=$check3 -> everything ok, merppcacoupdate worked -> continue" >> $scriptlog 2>&1;; 176 *) echo " check3=$check3 -> ERROR -> merppcacoupdate failed" >> $scriptlog 2>&1 176 0) echo " check3=$check3 -> everything ok, merppcacoupdate worked -> continue" >> $scriptlog 2>&1 177 printprocesslog "INFO merppupdated $calfile sucessfully with $cacofile" 178 ;; 179 *) echo " check3=$check3 -> ERROR -> merppcacoupdate failed" >> $scriptlog 2>&1 180 printprocesslog "ERROR merppcacoupdate failed for $calfile" 177 181 com=$Fmerppcaco 178 182 comadd=$runno … … 183 187 ;; 184 188 *) echo " check1=$check1 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1 189 printprocesslog "ERROR $program failed for sequence $sequence" 185 190 com=$Fcallisto 186 191 check=$check1 -
trunk/MagicSoft/Mars/datacenter/scripts/runganymed
r7938 r7944 37 37 # 38 38 39 source `dirname $0`/sourcefile 40 printprocesslog "INFO starting $0" 39 41 program=ganymed 40 source `dirname $0`/sourcefile 42 column=fGanymed 41 43 42 44 set -C 43 45 44 column=fGanymed 45 46 scriptlogpath=$runlogpath/$program 47 makedir $scriptlogpath 48 scriptlog=$scriptlogpath/run$program-$datetime.log 49 46 scriptlog=$runlogpath/run$program-$datetime.log 50 47 date >> $scriptlog 2>&1 51 48 … … 61 58 62 59 echo "run $program for dataset $dataset..." >> $scriptlog 2>&1 60 printprocesslog "INFO starting $program for dataset $dataset" 63 61 no=`printf %08d $dataset | cut -c 0-5` 64 62 no2=`printf %08d $dataset` … … 86 84 87 85 case $check1 in 88 0) echo " check1=$check1 -> everything ok " >> $scriptlog 2>&1 ;; 86 0) echo " check1=$check1 -> everything ok " >> $scriptlog 2>&1 87 printprocesslog "INFO $program finished successfully for dataset $dataset" 88 ;; 89 89 *) echo " check1=$check1 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1 90 printprocesslog "ERROR $program failed for dataset $dataset" 90 91 com=$Fganymed 91 92 check=$check1 -
trunk/MagicSoft/Mars/datacenter/scripts/runstar
r7938 r7944 37 37 # 38 38 39 source `dirname $0`/sourcefile 40 printprocesslog "INFO starting $0" 39 41 program=star 40 source `dirname $0`/sourcefile 42 column=fStar 41 43 42 44 set -C 43 45 44 column=fStar 45 46 scriptlogpath=$runlogpath/$program 47 makedir $scriptlogpath 48 scriptlog=$scriptlogpath/run$program-$datetime.log 49 46 scriptlog=$runlogpath/run$program-$datetime.log 50 47 date >> $scriptlog 2>&1 51 48 … … 61 58 62 59 echo "run $program for sequence $sequence..." >> $scriptlog 2>&1 60 printprocesslog "INFO starting $program for sequence $sequence" 63 61 no=`printf %08d $sequence | cut -c 0-4` 64 62 no2=`printf %08d $sequence` … … 77 75 78 76 case $check1 in 79 0) echo " check1=$check1 -> everything ok " >> $scriptlog 2>&1;; 77 0) echo " check1=$check1 -> everything ok " >> $scriptlog 2>&1 78 printprocesslog "INFO $program finished successfully for sequence $sequence" 79 ;; 80 80 *) echo " check1=$check1 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1 81 printprocesslog "ERROR $program failed for sequence $sequence" 81 82 com=$Fstar 82 83 check=$check1 -
trunk/MagicSoft/Mars/datacenter/scripts/scriptlauncher
r7936 r7944 18 18 # 19 19 # 20 # Author(s): Daniela Dorner 0 5/2005<mailto:dorner@astro.uni-wuerzburg.de>20 # Author(s): Daniela Dorner 08/2006 <mailto:dorner@astro.uni-wuerzburg.de> 21 21 # 22 22 # Copyright: MAGIC Software Development, 2000-2006 … … 29 29 30 30 source `dirname $0`/sourcefile 31 printprocesslog "INFO starting $0 $@" 31 32 32 33 makedir $listpath 33 34 makedir $lockpath 34 35 35 sllogpath=$logpath/scriptlauncher/`date +%Y/%m` 36 makedir $sllogpath 37 errorlog=$sllogpath/error`date +%F`.log 38 scriptlog=$sllogpath/scriptlauncher`date +%F`.log 36 errorlog=$runlogpath/scriptlauncher-error`date +%F`.log 37 scriptlog=$runlogpath/scriptlauncher`date +%F`.log 39 38 40 39 echo `date`": starting $0 $@" >> $scriptlog 2>&1 … … 53 52 fi 54 53 echo " launching $i..." >> $scriptlog 2>&1 55 pid=`/usr/local/bin/condor_submit -a path=$path -a prog=$i -a date=$date2 -a dir=$condordir $path/run.condor | grep cluster | cut -dr -f2` 2>$errorlog 54 if ! pid=`/usr/local/bin/condor_submit -a path=$path -a prog=$i -a date=$date2 -a dir=$condordir $path/run.condor | grep cluster | cut -dr -f2` 2>$errorlog 55 then 56 echo "condor is not working " >> $errorlog 2>&1 57 printprocesslog "ERROR submitting $i to condor failed" 58 fi 56 59 if ! echo $@ | grep "allatthesametime" >/dev/null 2>$errorlog 57 60 then … … 63 66 echo "" >> $scriptlog 2>&1 64 67 68 printprocesslog "INFO finished $0 $@" 69 -
trunk/MagicSoft/Mars/datacenter/scripts/setup
r7938 r7944 34 34 35 35 logpath=/magic/datacenter/autologs 36 runlogpath=/magic/datacenter/autologs/run/`date +%Y/%m/%d`37 36 lockpath=/magic/datacenter/locks 38 37 listpath=/magic/datacenter/lists … … 43 42 sequpath=/magic/sequences 44 43 datasetpath=/magic/datasets 44 45 45 46 46 webpath=/www/htdocs/datacenter … … 56 56 errorsleeptime=180 #180 57 57 max=16 #maximum number of processes 58 #log files (can't be defined in script itself, as script can run longer59 #than one day60 jmlogpath=$logpath/jobmanager/`date +%Y/%m`61 jmerrorlog=$jmlogpath/error`date +%F`.log62 jmscriptlog=$jmlogpath/jobmanager`date +%F`.log63 58 64 59 scripts=( "runcallisto" "runstar" "runganymed" "dodatacheck" ) … … 66 61 67 62 #hour: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 68 pnototal=( 16 16 16 16 16 16 16 1 2 12 12 10 10 10 12 12 12 12 12 12 1416 16 16 16 )63 pnototal=( 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 ) 69 64 pnototalwe=( 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 ) 70 65 71 pnocallisto=( 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8)72 pnostar=( 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8)73 pnoganymed=( 3 3 3 3 3 3 3 2 2 2 1 1 2 2 1 1 1 1 1 2 2 3 3 3)66 pnocallisto=( 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 ) 67 pnostar=( 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 ) 68 pnoganymed=( 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 ) 74 69 pnodatacheck=( 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 ) 75 70 76 pnocallistowe=( 1 0 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10)77 pnostarwe=( 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10)78 pnoganymedwe=( 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3)71 pnocallistowe=( 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 ) 72 pnostarwe=( 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 ) 73 pnoganymedwe=( 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 ) 79 74 pnodatacheckwe=( 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 ) 80 75 -
trunk/MagicSoft/Mars/datacenter/scripts/sourcefile
r7936 r7944 39 39 webpath=/www/htdocs/datacenter 40 40 41 processlogpath=$logpath/run/`date +%Y/%m/%d` 42 processlog=$processlogpath/process`date +%F`.log 41 runlogpath=$logpath/run/`date +%Y/%m/%d` 42 makedir $runlogpath 43 processlog=$runlogpath/process`date +%F`.log 43 44 44 45 datetime=`date +%F-%H-%M-%S` … … 76 77 # setup for jobmanager 77 78 # 79 #log files (can't be defined in script itself, as script can run longer 80 #than one day 81 jmerrorlog=$runlogpath/jobmanager-error`date +%F`.log 82 jmscriptlog=$runlogpath/jobmanager`date +%F`.log 78 83 steps=$mars/steps.rc 79 84 # resetting values … … 120 125 rm -v $lockfile 121 126 date 127 printprocesslog "INFO finished $program" 122 128 exit 123 129 } … … 234 240 ;; 235 241 *) echo "error -> exit" 236 exit 242 printprocesslog "ERROR function evalstatus got wrong variable" 243 finish 237 244 ;; 238 245 esac … … 304 311 if ! process=`mysql -s -u $us --password=$pw --host=hercules $db -e " $query "` 305 312 then 306 echo "ERROR could not query process from db -> exit" 313 echo "ERROR could not query processes from db -> exit" 314 printprocesslog "ERROR could not query processes from db (program: $program, function getdolist)" 307 315 finish 308 316 fi … … 318 326 then 319 327 echo "$todofile exists already" 328 printprocesslog "WARN $todofile exists already (program: $program, function getdolist)" 320 329 finish 321 330 fi … … 349 358 then 350 359 echo "ERROR could not query process from db -> exit" 360 printprocesslog "ERROR could not query process from db (program: $program, function gettodo)" 351 361 finish 352 362 fi … … 384 394 then 385 395 echo "ERROR could not query number of todo proceses from db -> continue" 396 printprocesslog "ERROR could not query number of processes from db (program: $program, function getstatus)" 386 397 cont 387 398 fi … … 400 411 then 401 412 echo "YOU CAN'T RESET $column for $var2!!!" 413 printprocesslog "ERROR you can't reset $column for $var2" 402 414 finish 403 415 fi … … 416 428 then 417 429 echo "ERROR could not insert status into db -> exit" 418 finish 419 fi 420 421 } 430 printprocesslog "ERROR could not set status in db (program: $program, function setstatus)" 431 finish 432 fi 433 434 } -
trunk/MagicSoft/Mars/datacenter/scripts/webupdate-callisto
r7915 r7944 29 29 30 30 source `dirname $0`/sourcefile 31 printprocesslog "INFO starting $0" 31 32 32 date 33 scriptlog=$runlogpath/webupdate-callisto-$datetime.log 34 date >> $scriptlog 2>&1 33 35 34 echo "do plots for all root-files (callisto) ..." 36 echo "do plots for all root-files (callisto) ..." >> $scriptlog 2>&1 35 37 $scriptspath/dowebplots -p callisto 36 38 39 echo "do rsync for callisto files" >> $scriptlog 2>&1 40 rsync -av --delete --exclude=*/*/*_E[.]root --exclude=*/*/callisto.rc $datapath/callisto/ $webpath/callisto >> $scriptlog 2>&1 37 41 38 echo "do rsync for callisto files"39 rsync -av --delete --exclude=*/*/*_E[.]root --exclude=*/*/callisto.rc $datapath/callisto/ $webpath/callisto42 echo "do rsync for subsystem files" >> $scriptlog 2>&1 43 rsync -av --delete /magic/subsystemdata/ $webpath/subsystemdata >> $scriptlog 2>&1 40 44 41 #echo "do rsync for subsystem files" 42 rsync -av --delete /magic/s ubsystemdata/ $webpath/subsystemdata45 echo "do rsync for sequence files" >> $scriptlog 2>&1 46 rsync -av --delete /magic/sequences/ $webpath/sequences >> $scriptlog 2>&1 43 47 44 echo "do rsync for sequence files" 45 rsync -av --delete /magic/sequences/ $webpath/sequences 48 date >> $scriptlog 2>&1 46 49 47 date 50 printprocesslog "INFO $0 finished" 48 51 49 -
trunk/MagicSoft/Mars/datacenter/scripts/webupdate-ganymed
r7916 r7944 29 29 30 30 source `dirname $0`/sourcefile 31 printprocesslog "INFO starting $0" 31 32 32 date 33 scriptlog=$runlogpath/webupdate-ganymed-$datetime.log 34 date >> $scriptlog 2>&1 33 35 34 echo "do plots for all root-files (ganymed) ..." 36 echo "do plots for all root-files (ganymed) ..." >> $scriptlog 2>&1 35 37 $scriptspath/dowebplots -p ganymed 36 38 37 echo "do rsync for ganymed files" 38 rsync -av --delete $datapath/ganymed/ $webpath/ganymed 39 echo "do rsync for ganymed files" >> $scriptlog 2>&1 40 rsync -av --delete $datapath/ganymed/ $webpath/ganymed >> $scriptlog 2>&1 39 41 40 echo "do rsync for dataset files" 41 rsync -av --delete /magic/datasets/ $webpath/datasets 42 echo "do rsync for dataset files" >> $scriptlog 2>&1 43 rsync -av --delete /magic/datasets/ $webpath/datasets >> $scriptlog 2>&1 42 44 43 date 45 date >> $scriptlog 2>&1 44 46 47 printprocesslog "INFO $0 finished" 45 48 -
trunk/MagicSoft/Mars/datacenter/scripts/webupdate-sinope
r7916 r7944 28 28 29 29 source `dirname $0`/sourcefile 30 printprocesslog "INFO starting $0" 30 31 31 date 32 scriptlog=$runlogpath/webupdate-sinope-$datetime.log 33 date >> $scriptlog 2>&1 32 34 33 echo "do plots for all root-files (sinope) ..." 34 $scriptspath/dowebplots -p sinope 35 echo "do plots for all root-files (sinope) ..." >> $scriptlog 2>&1 36 $scriptspath/dowebplots -p sinope >> $scriptlog 2>&1 35 37 36 echo "do rsync for sinope files" 37 rsync -av --delete $datapath/sinope/ $webpath/sinope 38 echo "do rsync for sinope files" >> $scriptlog 2>&1 39 rsync -av --delete $datapath/sinope/ $webpath/sinope >> $scriptlog 2>&1 38 40 39 date 41 date >> $scriptlog 2>&1 40 42 43 printprocesslog "INFO $0 finished" 41 44 -
trunk/MagicSoft/Mars/datacenter/scripts/webupdate-star
r7916 r7944 29 29 30 30 source `dirname $0`/sourcefile 31 printprocesslog "INFO starting $0" 31 32 32 date 33 scriptlog=$runlogpath/webupdate-star-$datetime.log 34 date >> $scriptlog 2>&1 33 35 34 echo "do plots for all root-files (star) ... " 36 echo "do plots for all root-files (star) ... " >> $scriptlog 2>&1 35 37 $scriptspath/dowebplots -p star 36 38 37 echo "do rsync for star files" 38 rsync -av --delete --exclude=*/*/*_E[.]root $datapath/star/ $webpath/star 39 echo "do rsync for star files" >> $scriptlog 2>&1 40 rsync -av --delete --exclude=*/*/*_E[.]root $datapath/star/ $webpath/star >> $scriptlog 2>&1 39 41 40 echo "do rsync for star files from la palma" 41 rsync -av --delete --exclude=*/*_E[.]root --exclude=*/Time*.dat /scratch/lapalma/star/ $webpath/star_lapalma 42 echo "do rsync for star files from la palma" >> $scriptlog 2>&1 43 rsync -av --delete --exclude=*/*_E[.]root --exclude=*/Time*.dat /scratch/lapalma/star/ $webpath/star_lapalma >> $scriptlog 2>&1 42 44 43 echo "do rsync for sequence files" 44 rsync -av --delete /magic/sequences/ $webpath/sequences 45 echo "do rsync for sequence files" >> $scriptlog 2>&1 46 rsync -av --delete /magic/sequences/ $webpath/sequences >> $scriptlog 2>&1 45 47 46 date 48 date >> $scriptlog 2>&1 47 49 50 printprocesslog "INFO $0 finished" 48 51 -
trunk/MagicSoft/Mars/datacenter/scripts/writesequencefiles
r7938 r7944 35 35 # 36 36 37 source `dirname $0`/sourcefile 38 printprocesslog "INFO starting $0" 37 39 program=writesequencefile 38 source `dirname $0`/sourcefile 40 column=fSequenceFileWritten 39 41 40 42 set -C 41 43 42 column=fSequenceFileWritten 43 44 lockfile=$lockpath/lock-$program.txt 45 46 scriptlogpath=$runlogpath/$program 47 makedir $scriptlogpath 48 scriptlog=$scriptlogpath/run$program-$datetime.log 49 44 scriptlog=$runlogpath/$program-$datetime.log 50 45 date >> $scriptlog 2>&1 51 46 52 47 # check if script is already running 48 lockfile=$lockpath/lock-$program.txt 53 49 checklock >> $scriptlog 2>&1 54 50 … … 71 67 for sequence in ${sequences[@]} 72 68 do 69 printprocesslog "INFO write sequence files for sequence $sequence" 73 70 no=`printf %08d $sequence | cut -c 0-4` 74 71 no2=`printf %08d $sequence` … … 87 84 check2=`root -q -b $macrospath/writesequencefile.C+\($sequence\,"\"$sequpath\""\) | tee $writesequencefilelog | grep int | sed -e 's/(int)//'` 88 85 case $check2 in 89 1) echo " check2=$check2 -> everything ok " >> $scriptlog 2>&1 ;; 86 1) echo " check2=$check2 -> everything ok " >> $scriptlog 2>&1 87 printprocesslog "INFO sequence file successfully written for sequence $sequence" 88 ;; 90 89 0) echo " check2=$check2 -> no connection to db -> continue..." >> $scriptlog 2>&1 90 printprocesslog "WARN connection to DB failed" 91 91 check="no" 92 92 ;; 93 93 *) echo " check2=$check2 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1 94 printprocesslog "ERROR $program.C failed for sequence $sequence" 94 95 com=$Fwritesequfile 95 96 check=$check2
Note:
See TracChangeset
for help on using the changeset viewer.