Changeset 9355 for trunk/MagicSoft
- Timestamp:
- 02/19/09 21:22:19 (16 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r9354 r9355 18 18 19 19 -*-*- END OF LINE -*-*- 20 2009/02/10 Daniela Dorner 21 22 * datacenter/scripts/buildsequenceentries, 23 datacenter/scripts/checkfilesforsequenceavail, 24 datacenter/scripts/checkstardone, datacenter/scripts/correcttime, 25 datacenter/scripts/dbchk, datacenter/scripts/dodatacheck, 26 datacenter/scripts/doexclusions, datacenter/scripts/fillcallisto, 27 datacenter/scripts/fillcamera, datacenter/scripts/fillganymed, 28 datacenter/scripts/fillstar, datacenter/scripts/insertdatasets, 29 datacenter/scripts/makecallistolinks, 30 datacenter/scripts/mcsequences, datacenter/scripts/movingrawfiles, 31 datacenter/scripts/movingrawfiles_OK, datacenter/scripts/runcamera, 32 datacenter/scripts/runcorsika, datacenter/scripts/runreflector, 33 datacenter/scripts/sourcefile, 34 datacenter/scripts/writedatasetfiles, 35 datacenter/scripts/writesequencefiles: 36 - removed scriptlog 37 38 * datacenter/scripts/jobmanager: 39 - fixed typo 40 41 42 20 43 2009/02/19 Thomas Bretz 21 44 -
trunk/MagicSoft/Mars/datacenter/scripts/buildsequenceentries
r9215 r9355 42 42 set -C 43 43 44 scriptlog=$runlogpath/$program-$datetime.log45 date >> $scriptlog 2>&146 47 44 # check if script is already running 48 45 lockfile=$lockpath/lock-$program.txt 49 checklock >> $scriptlog 2>&146 checklock 50 47 51 48 # get todo list 52 gettodo >> $scriptlog 2>&149 gettodo 53 50 54 51 cd $mars … … 58 55 date=${primaries[$s+$s]} 59 56 telnum=${primaries[$s+$s+1]} 60 echo "building sequence entries for date $date..." >> $scriptlog 2>&161 57 printprocesslog "INFO build sequence entries for $date" 62 58 year2=`echo $date | cut -c 1-4` 63 59 buildsequentriespath=$logpath/$program/$year2 64 makedir $buildsequentriespath >> $scriptlog 2>&160 makedir $buildsequentriespath 65 61 buildsequentrieslog=$buildsequentriespath/buildsequenceentries-$date.log 66 62 67 setstatus "start" >> $scriptlog 2>&163 setstatus "start" 68 64 69 65 check1=`root -q -b $macrospath/buildsequenceentries.C+\("\"$date\""\,"\"$datapath\""\,"\"$sequpath\""\,$telnum\,kFALSE\) | tee $buildsequentrieslog | intgrep` 70 66 71 67 case $check1 in 72 1) echo " check1=$check1 -> everything ok -> setting status for $date..." >> $scriptlog 2>&1 73 printprocesslog "INFO sequence entries successfully built for $date" 68 1) printprocesslog "INFO sequence entries successfully built for $date (check1=$check1)" 74 69 IFS=$'\n' 75 70 missing=( `grep "Missing" $buildsequentrieslog` ) … … 83 78 unset IFS 84 79 ;; 85 0) echo " check1=$check1 -> no connection to db -> continue..." >> $scriptlog 2>&1 86 printprocesslog "WARN connection to DB failed" 80 0) printprocesslog "WARN connection to DB failed (check1=$check1)" 87 81 check="no" 88 82 ;; 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" 83 *) printprocesslog "ERROR $program.C failed for $date (check1=$check1)" 91 84 com=$Fbuildsequ 92 85 check=$check1 … … 94 87 esac 95 88 96 setstatus "stop" >> $scriptlog 2>&189 setstatus "stop" 97 90 done 98 91 99 finish >> $scriptlog 2>&192 finish 100 93 -
trunk/MagicSoft/Mars/datacenter/scripts/checkfilesforsequenceavail
r9054 r9355 42 42 set -C 43 43 44 scriptlog=$runlogpath/$program-$datetime.log45 date >> $scriptlog 2>&146 47 44 # check if script is already running 48 45 lockfile=$lockpath/lock-$program.txt 49 checklock >> $scriptlog 2>&146 checklock 50 47 51 48 # get todo list 52 gettodo >> $scriptlog 2>&149 gettodo 53 50 54 51 cd $mars … … 58 55 sequence=${primaries[$s+$s]} 59 56 telnum=${primaries[$s+$s+1]} 60 echo "checking files for sequence $sequence..." >> $scriptlog 2>&161 57 printprocesslog "INFO checking files for sequence $sequence" 62 58 no=`printf %08d $sequence | cut -c 0-4` 63 59 no2=`printf %08d $sequence` 64 60 checkfileavailpath=$logpath/$program/$no 65 makedir $checkfileavailpath >> $scriptlog 2>&161 makedir $checkfileavailpath 66 62 checkfileavaillog=$checkfileavailpath/$program-$no2.log 67 63 68 setstatus "start" >> $scriptlog 2>&164 setstatus "start" 69 65 70 66 check1=`root -q -b $macrospath/checkfileavail.C+\($sequence,$telnum\) | tee $checkfileavaillog | intgrep` 71 67 72 68 case $check1 in 73 1) echo " check1=$check1 -> everything ok -> setting status..." >> $scriptlog 2>&1 74 printprocesslog "INFO files available for sequence $sequence" 69 1) printprocesslog "INFO files available for sequence $sequence (check1=$check1)" 75 70 ;; 76 2) echo " check1=$check1 -> files not yet available -> continue..." >> $scriptlog 2>&1 77 printprocesslog "INFO files not yet available for sequence $sequence" 71 2) printprocesslog "INFO files not yet available for sequence $sequence (check1=$check1)" 78 72 check="no" 79 73 ;; 80 0) echo " check1=$check1 -> no connection to db -> continue..." >> $scriptlog 2>&1 81 printprocesslog "WARN connection to DB failed" 74 0) printprocesslog "WARN connection to DB failed (check1=$check1)" 82 75 check="no" 83 76 ;; 84 *) echo " check1=$check1 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1 85 printprocesslog "ERROR $program.C failed for sequence $sequence" 77 *) printprocesslog "ERROR $program.C failed for sequence $sequence (check1=$check1)" 86 78 com=$Ffilesavail 87 79 check=$check1 … … 89 81 esac 90 82 91 setstatus "stop" >> $scriptlog 2>&183 setstatus "stop" 92 84 done 93 85 94 finish >> $scriptlog 2>&186 finish 95 87 -
trunk/MagicSoft/Mars/datacenter/scripts/checkstardone
r9113 r9355 40 40 column=fStarFilesAvail 41 41 42 scriptlog=$runlogpath/$program-$datetime.log43 date >> $scriptlog 2>&144 45 42 # check if script is already running 46 43 lockfile=$lockpath/lock-$program.txt 47 checklock >> $scriptlog 2>&144 checklock 48 45 49 46 # get todo list 50 gettodo >> $scriptlog 2>&147 gettodo 51 48 52 49 cd $mars … … 55 52 do 56 53 dataset=${primaries[$s]} 57 echo "checking star done for sequences of dataset $dataset..." >> $scriptlog 2>&158 54 printprocesslog "INFO checking star done for sequences of dataset $dataset" 59 55 60 56 outpath=$logpath/$program/`printf %08d $dataset | cut -c 0-5` 61 makedir $outpath >> $scriptlog 2>&157 makedir $outpath 62 58 63 setstatus "start" >> $scriptlog 2>&159 setstatus "start" 64 60 65 61 check1=`root -q -b $macrospath/checkstardone.C+\($dataset\) | tee $outpath/checkstardone-$dataset.log | intgrep` 66 62 67 63 case $check1 in 68 1) echo " check1=$check1 -> everything ok -> continue with next dataset..." >> $scriptlog 2>&1 ;; 69 2) echo " check1=$check1 -> star files for dataset $dataset not yet available -> continue..." >> $scriptlog 2>&1 70 printprocesslog "INFO files not yet available for dataset $dataset" 64 1) printprocesslog "INFO check1=$check1 -> everything ok -> continue with next dataset..." 65 2) printprocesslog "INFO files not yet available for dataset $dataset (check1=$check1)" 71 66 check="no" 72 67 ;; 73 0) echo " check1=$check1 -> no connection to db -> continue..." >> $scriptlog 2>&1 74 printprocesslog "WARN connection to DB failed" 68 0) printprocesslog "WARN connection to DB failed (check1=$check1)" 75 69 check="no" 76 70 ;; 77 *) echo " check1=$check1 -> ERROR checkstardone.C failed for dataset $dataset" >> $scriptlog 2>&1 78 printprocesslog "ERROR checkstardone.C failed for dataset $dataset" 71 *) printprocesslog "ERROR checkstardone.C failed for dataset $dataset (check1=$check1)" 79 72 com=$Fstardone 80 73 check=$check1 … … 82 75 esac 83 76 84 setstatus "stop" >> $scriptlog 2>&177 setstatus "stop" 85 78 done 86 79 87 finish >> $scriptlog 2>&180 finish -
trunk/MagicSoft/Mars/datacenter/scripts/correcttime
r9046 r9355 39 39 source `dirname $0`/sourcefile 40 40 printprocesslog "INFO starting $0" 41 echo "This script has not been adapted to the new file structure (MAGIC II) . "41 echo "This script has not been adapted to the new file structure (MAGIC II) and new logging. " 42 42 echo "Please adapt it before using it." 43 43 exit -
trunk/MagicSoft/Mars/datacenter/scripts/dbchk
r9131 r9355 46 46 program=dbchk 47 47 48 scriptlog=$runlogpath/$program-$datetime.log49 date >> $scriptlog 2>&150 51 48 getdbsetup 52 49 alias mymysql='mysql -s -u $us --password=$pw --host=$ho $db' 53 50 54 51 # check for crashed nights, runs, sequences and datasets 55 echo "Checking if something is crashed on nightly basis" >> $scriptlog 2>&1 52 printprocesslog "INFO Checking if something is crashed on nightly basis" 56 53 nights=`echo "SELECT fDate FROM SequenceBuildStatus WHERE isnull(fFailedTime) and not isnull(fStartTime) and adddate(fStartTime, Interval 12 HOUR) < Now()" | mymysql` 57 54 if [ ! "$nights" = "" ] 58 55 then 59 56 printprocesslog "WARN For the following nights something seems to be crashed. Please check manually: $nights" 60 echo "WARN For the following nights something seems to be crashed. Please check manually: $nights" >> $scriptlog 2>&161 57 else 62 echo " Nothing found." >> $scriptlog 2>&158 printprocesslog "INFO Nothing found." 63 59 fi 64 60 65 echo "Checking if something is crashed on run basis" >> $scriptlog 2>&1 61 printprocesslog "INFO Checking if something is crashed on run basis" 66 62 cruns=`echo "SELECT fRunNumber FROM RunProcessStatus WHERE isnull(fFailedTime) and not isnull(fStartTime) and adddate(fStartTime, Interval 12 HOUR) < Now()" | mymysql` 67 63 if [ ! "$cruns" = "" ] 68 64 then 69 65 printprocesslog "WARN The following runs seem to be crashed. Please check manually: $cruns" 70 echo "WARN The following runs seem to be crashed. Please check manually: $cruns" >> $scriptlog 2>&171 66 else 72 echo " Nothing found." >> $scriptlog 2>&167 printprocesslog "INFO Nothing found." 73 68 fi 74 69 75 echo "Checking if something is crashed on sequence basis" >> $scriptlog 2>&1 70 printprocesslog "INFO Checking if something is crashed on sequence basis" 76 71 csequences=`echo "SELECT fSequenceFirst FROM SequenceProcessStatus WHERE isnull(fFailedTime) and not isnull(fStartTime) and adddate(fStartTime, Interval 12 HOUR) < Now()" | mymysql` 77 72 if [ ! "$csequences" = "" ] 78 73 then 79 74 printprocesslog "WARN The following sequences seem to be crashed. Please check manually: $csequences" 80 echo "WARN The following sequences seem to be crashed. Please check manually: $csequences" >> $scriptlog 2>&181 75 else 82 echo " Nothing found." >> $scriptlog 2>&176 printprocesslog "INFO Nothing found." 83 77 fi 84 78 85 echo "Checking if something is crashed on dataset basis" >> $scriptlog 2>&1 79 printprocesslog "INFO Checking if something is crashed on dataset basis" 86 80 cdatasets=`echo "SELECT fDataSetNumber FROM DataSetProcessStatus WHERE isnull(fFailedTime) and not isnull(fStartTime) and adddate(fStartTime, Interval 12 HOUR) < Now()" | mymysql` 87 81 if [ ! "$cdatasets" = "" ] 88 82 then 89 83 printprocesslog "WARN The following datasets seem to be crashed. Please check manually: $cdatasets" 90 echo "WARN The following datasets seem to be crashed. Please check manually: $cdatasets" >> $scriptlog 2>&191 84 else 92 echo " Nothing found." >> $scriptlog 2>&185 printprocesslog "INFO Nothing found." 93 86 fi 94 87 95 88 # CHECK 1 96 echo "Checking if all sequence files have a corresponding entry in Sequences" >> $scriptlog 2>&1 89 printprocesslog "INFO Checking if all sequence files have a corresponding entry in Sequences" 97 90 files=`find $sequpath -type f` 98 91 for file in $files … … 101 94 if [ "$sequence" = "" ] || [ "$sequence" = "$file" ] 102 95 then 103 echo "No sequence file: $file" >> $scriptlog 2>&1104 96 printprocesslog "ERROR No sequence file: $file" 105 97 continue … … 109 101 if ! [ "$sequence" = "$var" ] 110 102 then 111 echo "Sequence-File $sequence exist but it is not in Sequences." >> $scriptlog 2>&1112 103 printprocesslog "ERROR Sequence-File $sequence exists, but it is not in Sequences (DB)." 113 104 continue … … 116 107 117 108 # CHECK 1b (callisto) 118 echo "Checking if all sequences in ${datapath}/callisto have a corresponding sequence in Sequence" >> $scriptlog 2>&1 109 printprocesslog "INFO Checking if all sequences in ${datapath}/callisto have a corresponding sequence in Sequence" 119 110 dirs=`find ${datapath}/callisto -mindepth 2 -maxdepth 2 -type d` 120 111 for dir in $dirs … … 123 114 if [ "$sequence" = "" ] || [ "$sequence" = "$dir" ] 124 115 then 125 echo "Invalid directory: $dir" >> $scriptlog 2>&1126 116 printprocesslog "ERROR Invalid directory: $dir" 127 117 continue … … 131 121 if ! [ "$sequence" = "$var" ] 132 122 then 133 echo "$dir exists but no corresponding sequence in Sequences." >> $scriptlog 2>&1134 123 printprocesslog "ERROR $dir exists, but no corresponding sequence in Sequences (DB)." 135 124 continue … … 138 127 139 128 # CHECK 1c (star) 140 echo "Checking if all sequences in ${datapath}/star have a corresponding sequence in Sequence" >> $scriptlog 2>&1 129 printprocesslog "INFO Checking if all sequences in ${datapath}/star have a corresponding sequence in Sequence" 141 130 dirs=`find ${datapath}/star -mindepth 2 -type d` 142 131 for dir in $dirs … … 145 134 if [ "$sequence" = "" ] || [ "$sequence" = "$dir" ] 146 135 then 147 echo "Invalid directory: $dir" >> $scriptlog 2>&1148 136 printprocesslog "ERROR Invalid directory: $dir" 149 137 continue … … 153 141 if ! [ "$sequence" = "$var" ] 154 142 then 155 echo "$dir exists but no corresponding sequence in Sequences." >> $scriptlog 2>&1156 143 printprocesslog "ERROR $dir exists, but no corresponding sequence in Sequences (DB)." 157 144 continue … … 160 147 161 148 # CHECK 2 162 echo "Checking if all sequences in Sequences have a corresponding sequence files" >> $scriptlog 2>&1 149 printprocesslog "INFO Checking if all sequences in Sequences have a corresponding sequence files" 163 150 sequences=`echo SELECT fSequenceFirst FROM Sequences left join SequenceProcessStatus using (fSequenceFirst,fTelescopeNumber) where not isnull(fSequenceFileWritten) | mymysql` 164 151 for sequence in $sequences … … 167 154 if [ "$var" = "" ] 168 155 then 169 echo "Sequence-File for $sequence not found but in db." >> $scriptlog 2>&1170 156 printprocesslog "ERROR Sequence-File for $sequence not found but in DB." 171 157 fi … … 173 159 174 160 # CHECK 3 175 echo "Checking if all sequences from Sequences exist RunData" >> $scriptlog 2>&1 161 printprocesslog "INFO Checking if all sequences from Sequences exist RunData" 176 162 sequences=`echo SELECT fSequenceFirst FROM Sequences GROUP BY fSequenceFirst | mymysql` 177 163 for sequence in $sequences … … 180 166 if ! [ "$sequence" = "$res" ] 181 167 then 182 echo "Sequence $sequence exists in Sequences but not in RunData." >> $scriptlog 2>&1 183 printprocesslog "Sequence $sequence exists in Sequences but not in RunData (DB)." 168 printprocesslog "ERROR Sequence $sequence exists in Sequences but not in RunData (DB)." 184 169 continue 185 170 fi … … 187 172 188 173 # CHECK 4 189 echo "Checking if all sequences from RunData exist in Sequences" >> $scriptlog 2>&1 174 printprocesslog "INFO Checking if all sequences from RunData exist in Sequences" 190 175 sequences=`echo SELECT fSequenceFirst FROM RunData WHERE not fSequenceFirst=0 GROUP BY fSequenceFirst | mymysql` 191 176 for sequence in $sequences … … 194 179 if ! [ "$sequence" = "$var" ] 195 180 then 196 echo "Sequence $sequence exists in RunData but not in Sequences." >> $scriptlog 2>&1 197 printprocesslog "Sequence $sequence exists in RunData but not in Sequences (DB)." 181 printprocesslog "ERROR Sequence $sequence exists in RunData but not in Sequences (DB)." 198 182 continue 199 183 fi … … 201 185 202 186 # CHECK 5 203 echo "Checking if all sequences from RunData exist in SequenceProcessStatus" >> $scriptlog 2>&1 187 printprocesslog "INFO Checking if all sequences from RunData exist in SequenceProcessStatus" 204 188 sequences=`echo SELECT fSequenceFirst FROM RunData WHERE not fSequenceFirst=0 GROUP BY fSequenceFirst | mymysql` 205 189 for sequence in $sequences … … 208 192 if ! [ "$sequence" = "$var" ] 209 193 then 210 echo "Sequence $sequence exists in RunData but not in SequenceProcessStatus." >> $scriptlog 2>&1 211 printprocesslog "Sequence $sequence exists in RunData but not in SequenceProcessStatus (DB)." 194 printprocesslog "ERROR Sequence $sequence exists in RunData but not in SequenceProcessStatus (DB)." 212 195 continue 213 196 fi 214 197 done 215 198 216 finish >> $scriptlog 2>&1199 finish -
trunk/MagicSoft/Mars/datacenter/scripts/dodatacheck
r9223 r9355 41 41 source `dirname $0`/sourcefile 42 42 printprocesslog "INFO starting $0" 43 echo "This script has not been adapted to the new file structure (MAGIC II) . "43 echo "This script has not been adapted to the new file structure (MAGIC II) and new logging. " 44 44 echo "Only the usage of getodo has been adapted, but not tested." 45 45 echo "Please adapt it before using it." -
trunk/MagicSoft/Mars/datacenter/scripts/doexclusions
r9054 r9355 42 42 set -C 43 43 44 scriptlog=$runlogpath/$program-$datetime.log45 date >> $scriptlog 2>&146 47 44 # check if the script is already running 48 45 lockfile=$lockpath/lock-$program.txt 49 checklock >> $scriptlog 2>&146 checklock 50 47 51 48 # get todo list 52 gettodo >> $scriptlog 2>&149 gettodo 53 50 54 51 cd $mars … … 59 56 date=${primaries[$s+$s]} 60 57 telnum=${primaries[$s+$s+1]} 61 echo "do exclusions for date "$date >> $scriptlog 2>&1 62 printprocesslog "INFO do exclusions for $date" 58 printprocesslog "INFO do exclusions for $date $date" 63 59 year2=`echo $date | cut -c 1-4` 64 60 doexclusionspath=$logpath/$program/$year2 65 makedir $doexclusionspath >> $scriptlog 2>&161 makedir $doexclusionspath 66 62 doexclusionslog=$doexclusionspath/doexclusions-$date.log 67 63 68 setstatus "start" >> $scriptlog 2>&164 setstatus "start" 69 65 70 66 check1=`root -q -b $macrospath/doexclusions.C+\("\"$date\""\,$telnum\,kFALSE\) | tee $doexclusionslog | intgrep` 71 67 72 68 case $check1 in 73 1) echo " check1=$check1 -> everything ok -> setting status..." >> $scriptlog 2>&1 74 printprocesslog "INFO exclusions successfully done for $date" 69 1) printprocesslog "INFO exclusions successfully done for $date (check1=$check1)" 75 70 ;; 76 0) echo " check1=$check1 -> no connection to db -> continue..." >> $scriptlog 2>&1 77 printprocesslog "WARN connection to DB failed" 71 0) printprocesslog "WARN connection to DB failed (check1=$check1)" 78 72 check="no" 79 73 ;; 80 *) echo " check1=$check1 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1 81 printprocesslog "ERROR $program.C failed" 74 *) printprocesslog "ERROR $program.C failed (check1=$check1)" 82 75 com=$Fdoexcl 83 76 check=$check1 … … 85 78 esac 86 79 87 setstatus "stop" >> $scriptlog 2>&180 setstatus "stop" 88 81 done 89 82 90 finish >> $scriptlog 2>&183 finish 91 84 -
trunk/MagicSoft/Mars/datacenter/scripts/fillcallisto
r9054 r9355 43 43 set -C 44 44 45 scriptlog=$runlogpath/$program-$datetime.log46 date >> $scriptlog 2>&147 48 45 # check if the script is already running 49 46 lockfile=$lockpath/lock-$program.txt 50 checklock >> $scriptlog 2>&147 checklock 51 48 52 49 # get todo file 53 gettodo >> $scriptlog 2>&150 gettodo 54 51 55 52 cd $mars … … 67 64 calibfile=$path/calib$no2.root 68 65 fillcallistologpath=$logpath/$program/$no 69 makedir $fillcallistologpath >> $scriptlog 2>&166 makedir $fillcallistologpath 70 67 fillcaliblog=$fillcallistologpath/fillcalib-$sequence.log 71 68 fillsignallog=$fillcallistologpath/fillsignal-$sequence.log 72 69 73 echo "run $program for sequence $sequence" >> $scriptlog 2>&1 74 setstatus "start" >> $scriptlog 2>&1 75 echo "run fillcalib..." >> $scriptlog 2>&1 70 printprocesslog "INFO run $program for sequence $sequence" 71 setstatus "start" 76 72 printprocesslog "INFO starting fillcalib for sequence $sequence" 77 73 … … 79 75 80 76 case $check1 in 81 1) echo " check1=$check1 -> everything ok -> run fillsignal " >> $scriptlog 2>&1 82 printprocesslog "INFO done fillcalib successfully for sequence $sequence" 77 1) printprocesslog "INFO done fillcalib successfully for sequence $sequence (check1=$check1)" 83 78 ;; 84 0) echo " check1=$check1 -> no connection to db -> continue..." >> $scriptlog 2>&1 85 printprocesslog "WARN connection to DB failed" 79 0) printprocesslog "WARN connection to DB failed (check1=$check1)" 86 80 check="no" 87 setstatus "stop" >> $scriptlog 2>&181 setstatus "stop" 88 82 continue ;; 89 *) echo " check1=$check1 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1 90 printprocesslog "ERROR fillcalib failed for sequence $sequence" 83 *) printprocesslog "ERROR fillcalib failed for sequence $sequence (check1=$check1)" 91 84 com=$Ffillcalib 92 85 check=$check1 93 setstatus "stop" >> $scriptlog 2>&186 setstatus "stop" 94 87 continue ;; 95 88 esac … … 98 91 check2=`root -q -b $macrospath/fillsignal.C+\("\"$signalfile\""\,kFALSE\) | tee $fillsignallog | intgrep` 99 92 case $check2 in 100 1) echo " check2=$check2 -> everything ok " >> $scriptlog 2>&1 101 printprocesslog "INFO done fillsignal successfully for sequence $sequence" 93 1) printprocesslog "INFO done fillsignal successfully for sequence $sequence (check2=$check2)" 102 94 ;; 103 0) echo " check2=$check2 -> no connection to db -> continue..." >> $scriptlog 2>&1 104 printprocesslog "WARN connection to DB failed" 95 0) printprocesslog "WARN connection to DB failed (check2=$check2)" 105 96 check="no" 106 97 ;; 107 *) echo " check2=$check2 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1 108 printprocesslog "ERROR fillsignal failed for sequence $sequence" 98 *) printprocesslog "ERROR fillsignal failed for sequence $sequence (check2=$check2)" 109 99 com=$Ffillsignal 110 100 check=$check2 … … 112 102 esac 113 103 114 setstatus "stop" >> $scriptlog 2>&1104 setstatus "stop" 115 105 done 116 106 117 finish >> $scriptlog 2>&1107 finish 118 108 -
trunk/MagicSoft/Mars/datacenter/scripts/fillcamera
r9217 r9355 1 #!/bin/sh1 #!/bin/sh 2 2 # 3 3 # ======================================================================== … … 35 35 set -C 36 36 37 scriptlog=$runlogpath/$program-$datetime.log38 date >> $scriptlog 2>&139 40 37 # check if script is already running 41 38 lockfile=$lockpath/lock-$program.txt 42 checklock >> $scriptlog 2>&139 checklock 43 40 44 41 getdbsetup … … 48 45 #workaround 49 46 cameradirs=`find /magic/montecarlo/camera -maxdepth 4 -mindepth 2 -type d ! -name Gamma ! -name Muon ! -name Proton ! -name Spot_?.?` 50 echo "camera dirs: "${cameradirs[@]} >> $scriptlog 2>&1 51 echo "" >> $scriptlog 2>&1 47 printprocesslog "INFO camera dirs: "${cameradirs[@]} 52 48 53 49 cd $mars … … 66 62 fi 67 63 epo=`echo $cameradir | cut -d/ -f5` #epoch 68 echo "dir: "$cameradir >> $scriptlog 2>&164 printprocesslog "INFO dir: "$cameradir 69 65 fillcamerapath=$logpath/$program 70 makedir $fillcamerapath >> $scriptlog 2>&166 makedir $fillcamerapath 71 67 fillcameralog=$fillcamerapath/$program-$epo-$par-$spot-$cam.log 72 68 … … 74 70 # check0=`root -q -b $macrospath/fillcamera.C+\("\"$cameradir\""\,kTRUE\) | tee $fillcameralog | intgrep` 75 71 case $check0 in 76 1) echo "check0=$check0 -> everything ok " >> $scriptlog 2>&1 77 printprocesslog "INFO fillcamera run successfully for dir $cameradir" 72 1) printprocesslog "INFO fillcamera run successfully for dir $cameradir (check0=$check0)" 78 73 ;; 79 0) echo " check1=$check1 -> no connection to db -> continue..." >> $scriptlog 2>&1 80 printprocesslog "WARN connection to DB failed" 74 0) printprocesslog "WARN connection to DB failed (check0=$check0)" 81 75 check="no" 82 76 ;; 83 *) echo "check0=$check0 -> ERROR " >> $scriptlog 2>&1 84 printprocesslog "ERROR $program.C failed for dir $cameradir" 77 *) printprocesslog "ERROR $program.C failed for dir $cameradir (check0=$check0)" 85 78 ;; 86 79 esac 87 80 88 81 printprocesslog "INFO linking cal and ped files" 89 echo "linking cal and ped files" >> $scriptlog 2>&190 82 91 83 if [ $cam = "Cal_and_Ped" ]; 92 84 then 93 echo "Cal_and_Ped folder, no cal and ped files will be linked" >> $scriptlog 2>&185 printprocesslog "INFO Cal_and_Ped folder, no cal and ped files will be linked" 94 86 else 95 87 … … 99 91 calfile=`find $mccampath/$epo/Cal_and_Ped -name *_C_*.root` 100 92 101 echo "calfile for epoch $epo : " $calfile >> $scriptlog 2>&1102 echo "pedfile for epoch $epo : " $pedfile >> $scriptlog 2>&193 printprocesslog "INFO calfile for epoch $epo : " $calfile 94 printprocesslog "INFO pedfile for epoch $epo : " $pedfile 103 95 104 96 #check number of files … … 107 99 if [ "$numfiles" != "2" ] 108 100 then 109 echo "too many or too less files in the directory $epo/Cal_and_Ped -> exit" >> $scriptlog 2>&1 110 rm -v $lockfile >> $scriptlog 2>&1 111 exit 112 printprocesslog "ERROR too many ped and cal files found in $epo/Cal_and_Ped" 113 finish >> $scriptlog 2>&1 101 printprocesslog "ERROR too many or too less ped and cal files found in $epo/Cal_and_Ped" 102 finish 114 103 fi 115 104 … … 122 111 cnum=`printf %08d $crun` 123 112 pnum=`printf %08d $prun` 124 echo "calrun number: " $cnum >> $scriptlog 2>&1125 echo "pedrun number: " $pnum >> $scriptlog 2>&1113 printprocesslog "INFO calrun number: " $cnum 114 printprocesslog "INFO pedrun number: " $pnum 126 115 #get all directories in the linked structure for the epoch 127 116 #dirs=`find $mcrawpath/ -mindepth 3 -maxdepth 3 -type d` … … 142 131 if ls $dir | grep MonteCarlo | grep $pnum 143 132 then 144 echo "P run already there, do mysql update" >> $scriptlog 2>&1133 printprocesslog "INFO P run already there, do mysql update" 145 134 # continue 146 135 mysql -ss -u $us --password=$pw --host=$ho $db -e " $pupdate " 147 136 else 148 echo "linking P run for epoch $epo" >> $scriptlog 2>&1149 ln -sv $pedfile $newpedfile >> $scriptlog 2>&1137 printprocesslog "INFO linking P run for epoch $epo" 138 ln -sv $pedfile $newpedfile 150 139 mysql -ss -u $us --password=$pw --host=$ho $db -e " $pupdate " 151 140 fi … … 153 142 if ls $dir | grep MonteCarlo | grep $cnum 154 143 then 155 echo "C run already there, do mysql update" >> $scriptlog 2>&1144 printprocesslog "INFO C run already there, do mysql update" 156 145 # continue 157 146 mysql -ss -u $us --password=$pw --host=$ho $db -e " $cupdate " 158 147 else 159 echo "linking C run for epoch $epo" >> $scriptlog 2>&1160 ln -sv $calfile $newcalfile >> $scriptlog 2>&1148 printprocesslog "INFO linking C run for epoch $epo" 149 ln -sv $calfile $newcalfile 161 150 mysql -ss -u $us --password=$pw --host=$ho $db -e " $cupdate " 162 151 fi … … 211 200 212 201 213 finish >> $scriptlog 2>&1214 202 finish 203 -
trunk/MagicSoft/Mars/datacenter/scripts/fillganymed
r9133 r9355 42 42 set -C 43 43 44 scriptlog=$runlogpath/$program-$datetime.log45 date >> $scriptlog 2>&146 47 44 # check if script is already running 48 45 lockfile=$lockpath/lock-$program.txt 49 checklock >> $scriptlog 2>&146 checklock 50 47 51 48 # get todo list 52 gettodo >> $scriptlog 2>&149 gettodo 53 50 54 51 cd $mars … … 64 61 ganymedfile=$path/ganymed$no2.root 65 62 fillganymedlogpath=$logpath/$program/$no 66 makedir $fillganymedlogpath >> $scriptlog 2>&163 makedir $fillganymedlogpath 67 64 fillganymedlog=$fillganymedlogpath/$program-$dataset.log 68 65 69 echo "run $program for dataset $dataset" >> $scriptlog 2>&170 setstatus "start" >> $scriptlog 2>&166 printprocesslog "INFO run $program for dataset $dataset" 67 setstatus "start" 71 68 72 69 check2=`root -q -b $macrospath/fillganymed.C+\("\"$ganymedfile\""\,kFALSE\) | tee $fillganymedlog | intgrep` 73 70 case $check2 in 74 1) echo " check2=$check2 -> everything ok " >> $scriptlog 2>&1 75 printprocesslog "INFO done fillganymed successfully for dataset $dataset" 71 1) printprocesslog "INFO done fillganymed successfully for dataset $dataset (check2=$check2)" 76 72 ;; 77 0) echo " check2=$check2 -> no connection to db -> continue..." >> $scriptlog 2>&1 78 printprocesslog "WARN connection to DB failed" 73 0) printprocesslog "WARN connection to DB failed (check2=$check2)" 79 74 check="no" 80 75 ;; 81 *) echo " check2=$check2 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1 82 printprocesslog "ERROR fillganymed failed for dataset $datset" 76 *) printprocesslog "ERROR fillganymed failed for dataset $datset (check2=$check2)" 83 77 com=$Ffillganymed 84 78 check=$check2 … … 86 80 esac 87 81 88 setstatus "stop" >> scriptlog 2>&182 setstatus "stop" 89 83 done 90 84 91 finish >> $scriptlog 2>&185 finish 92 86 -
trunk/MagicSoft/Mars/datacenter/scripts/fillstar
r9054 r9355 42 42 set -C 43 43 44 scriptlog=$runlogpath/$program-$datetime.log45 date >> $scriptlog 2>&146 47 44 # check if the script is already running 48 45 lockfile=$lockpath/lock-$program.txt 49 checklock >> $scriptlog 2>&146 checklock 50 47 51 48 # get todo list 52 gettodo >> $scriptlog 2>&149 gettodo 53 50 54 51 cd $mars … … 65 62 starfile=$path/star$no2.root 66 63 fillstarlogpath=$logpath/$program/$no 67 makedir $fillstarlogpath >> $scriptlog 2>&164 makedir $fillstarlogpath 68 65 fillstarlog=$fillstarlogpath/$program-$sequence.log 69 66 70 echo "run $program for sequence $sequence" >> $scriptlog 2>&1 71 setstatus "start" >> $scriptlog 2>&1 67 setstatus "start" 72 68 73 69 check2=`root -q -b $macrospath/fillstar.C+\("\"$starfile\""\,kFALSE\) | tee $fillstarlog | intgrep` 74 70 case $check2 in 75 1) echo " check2=$check2 -> everything ok " >> $scriptlog 2>&1 76 printprocesslog "INFO done fillstar successfully for sequence $sequence" 71 1) printprocesslog "INFO done fillstar successfully for sequence $sequence (check2=$check2)" 77 72 ;; 78 0) echo " check2=$check2 -> no connection to db -> continue..." >> $scriptlog 2>&1 79 printprocesslog "WARN connection to DB failed" 73 0) printprocesslog "WARN connection to DB failed (check2=$check2)" 80 74 check="no" 81 75 ;; 82 *) echo " check2=$check2 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1 83 printprocesslog "ERROR fillstar failed for sequence $sequence" 76 *) printprocesslog "ERROR fillstar failed for sequence $sequence (check2=$check2)" 84 77 com=$Ffillstar 85 78 check=$check2 … … 87 80 esac 88 81 89 setstatus "stop" >> $scriptlog 2>&182 setstatus "stop" 90 83 done 91 84 92 finish >> $scriptlog 2>&185 finish 93 86 -
trunk/MagicSoft/Mars/datacenter/scripts/insertdatasets
r8482 r9355 38 38 set -C 39 39 40 scriptlog=$runlogpath/$program-$datetime.log41 date >> $scriptlog 2>&142 43 40 # check if script is already running 44 41 lockfile=$lockpath/lock-$program.txt 45 checklock >> $scriptlog 2>&142 checklock 46 43 47 44 # get all datasetfiles 48 45 datasetfiles=(`ls $datasetpath/*/*.txt`) 49 echo "datasetfiles: "${datasetfiles[@]} >> $scriptlog 2>&1 50 echo "" >> $scriptlog 2>&1 46 printprocesslog "INFO datasetfiles: "${datasetfiles[@]} 51 47 52 48 cd $mars … … 66 62 if [ "$no" = "$no3" ] 67 63 then 68 echo "number in filename and in file are the same -> continue" >> $scriptlog 2>&164 printprocesslog "INFO number in filename and in file are the same -> continue" 69 65 else 70 echo "number in filename and in file are not the same " >> $scriptlog 2>&171 echo " -> continue with next dataset" >> $scriptlog 2>&172 66 printprocesslog "ERROR number in filename ($no) and file ($no3) are not the same for dataset $no2" 73 67 continue 74 68 fi 75 69 # get source name, comment and observation mode from dataset file 76 source=`grep 'SourceName:' $datasetfile | sed -e 's/SourceName://g' | sed -e 's/ //g' | sed -e 's/#//g'` >> $scriptlog 2>&177 comment=`grep 'Comment:' $datasetfile | sed -e 's/Comment://g'` >> $scriptlog 2>&178 mode=`grep 'WobbleMode:' $datasetfile` >> $scriptlog 2>&179 mode2=`echo $mode | grep ^\#` >> $scriptlog 2>&170 source=`grep 'SourceName:' $datasetfile | sed -e 's/SourceName://g' | sed -e 's/ //g' | sed -e 's/#//g'` 71 comment=`grep 'Comment:' $datasetfile | sed -e 's/Comment://g'` 72 mode=`grep 'WobbleMode:' $datasetfile` 73 mode2=`echo $mode | grep ^\#` 80 74 if [ "$mode2" = "" ] 81 75 then 82 wobble="Y" >> $scriptlog 2>&176 wobble="Y" 83 77 else 84 wobble="N" >> $scriptlog 2>&178 wobble="N" 85 79 fi 86 echo "file: "$datasetfile >> $scriptlog 2>&187 echo " datasetno: "$no2 >> $scriptlog 2>&188 echo " sourcename: "$source >> $scriptlog 2>&189 echo " wobble: "$wobble >> $scriptlog 2>&190 echo " comment: "$comment >> $scriptlog 2>&191 echo " " >> $scriptlog 2>&192 80 93 81 insertdatasetpath=$logpath/insertdataset/$no4 94 makedir $insertdatasetpath >> $scriptlog 2>&182 makedir $insertdatasetpath 95 83 insertdatasetlog=$insertdatasetpath/insertdataset-$no3.log 96 84 … … 99 87 check0=`root -q -b $macrospath/insertdataset.C+\("\"$no2\""\,"\"$source\""\,"\"$wobble\""\,"\"$comment\""\,kFALSE\) | tee $insertdatasetlog | intgrep` 100 88 case $check0 in 101 1) echo " check0=$check0 -> everything ok " >> $scriptlog 2>&1 102 printprocesslog "INFO dataset $no2 successfully inserted" 89 1) printprocesslog "INFO dataset $no2 successfully inserted (check0=$check0)" 103 90 ;; 104 3) echo " check0=$check0 -> everything ok " >> $scriptlog 2>&1 105 printprocesslog "INFO dataset $no2 exists already" 91 3) printprocesslog "INFO dataset $no2 exists already (check0=$check0)" 106 92 ;; 107 0) echo " check1=$check1 -> no connection to db -> continue..." >> $scriptlog 2>&1 108 printprocesslog "WARN connection to DB failed" 93 0) printprocesslog "WARN connection to DB failed (check0=$check0)" 109 94 check="no" 110 95 ;; 111 *) echo " check0=$check0 -> ERROR " >> $scriptlog 2>&1 112 printprocesslog "ERROR $program.C failed for dataset $no2" 96 *) printprocesslog "ERROR $program.C failed for dataset $no2 (check0=$check0)" 113 97 ;; 114 98 esac 115 99 done 116 100 117 finish >> $scriptlog 2>&1101 finish 118 102 -
trunk/MagicSoft/Mars/datacenter/scripts/jobmanager
r9129 r9355 97 97 column=${scriptscolname[$i]} 98 98 getstatus >> $jmscriptlog 2>&1 99 echo " $numproc ${scripts[$i]} still do to" >> $jmscriptlog 2>&199 echo " $numproc ${scripts[$i]} still to do" >> $jmscriptlog 2>&1 100 100 if [ "$numproc" = "" ] 101 101 then -
trunk/MagicSoft/Mars/datacenter/scripts/makecallistolinks
r9107 r9355 41 41 set -C 42 42 43 scriptlog=$runlogpath/$program`date +%F`.log44 date >> $scriptlog 2>&145 46 43 # check if script is already running 47 44 lockfile=$lockpath/lock-$program.txt 48 checklock >> $scriptlog 2>&145 checklock 49 46 50 47 callistorcseq=callisto.rc … … 56 53 if [ ${#primaries[@]} -eq 0 ] 57 54 then 58 echo "nothing to do -> exit" >> $scriptlog 2>&159 finish >> $scriptlog 2>&155 printprocesslog "INFO nothing to do -> exit" 56 finish 60 57 fi 61 58 num=`expr ${#primaries[@]} / 2 ` … … 69 66 telnum=${primaries[$s+$s+1]} 70 67 callistorc=$datapath/callisto/`printf %08d $sequence | cut -c 0-4`/`printf %08d $sequence`/$callistorcseq 71 if ! ls -l $callistorc 2>/dev/null | grep $callistorcnew >> $scriptlog 2>&168 if ! ls -l $callistorc 2>/dev/null | grep $callistorcnew 72 69 then 73 70 printprocesslog "INFO linking $callistorcnew to $callistorc for sequ $sequence" 74 71 # resetting the calibration 75 echo "resetting the callisto for sequence $sequence" >> $scriptlog 2>&172 printprocesslog "INFO resetting the callisto for sequence $sequence" 76 73 77 74 query="UPDATE SequenceProcessStatus set fStartTime=NULL, fFailedTime=NULL, fProgramId=NULL, fReturnCode=NULL where fSequenceFirst=$sequence and fTelescopeNumber=$telnum" 78 if ! sendquery >> $scriptlog 2>&175 if ! sendquery 79 76 then 80 77 printprocesslog "ERROR resetting calibration failed for sequence $sequence" … … 85 82 86 83 #linking callisto.rc 87 if ln -vfs $setuppath/callisto/$callistorcnew $callistorc >> $scriptlog 2>&184 if ln -vfs $setuppath/callisto/$callistorcnew $callistorc 88 85 then 89 86 printprocesslog "INFO link callisto.rc successfully for sequence $sequence" … … 95 92 done 96 93 97 finish >> $scriptlog 2>&194 finish 98 95 -
trunk/MagicSoft/Mars/datacenter/scripts/mcsequences
r9225 r9355 37 37 set -C 38 38 39 scriptlog=$runlogpath/$program-$datetime.log40 date >> $scriptlog 2>&141 42 39 # check if script is already running 43 40 lockfile=$lockpath/lock-$program.txt 44 checklock >> $scriptlog 2>&141 checklock 45 42 46 43 # find montecarlo directories, build two sequences per directory and write sequence files … … 58 55 continue 59 56 fi 60 echo $dir >> $scriptlog 2>&157 printprocesslog "INFO dir: "$dir 61 58 62 59 epochs=`ls -l $mcpath/camera | cut -c 52-80` 63 60 for epoch in ${epochs[@]} 64 61 do 65 echo $epoch >> $scriptlog 2>&162 printprocesslog "INFO epoch: "$epoch 66 63 calfile=`find $dir -lname *${epoch}/*.root | grep "_C_"` 67 64 pedfile=`find $dir -lname *${epoch}/*.root | grep "_P_"` … … 140 137 trainno=`echo $firstruntrain | cut -c 0-4` 141 138 trainsequpath=$mcsequpath/$trainno 142 makedir $trainsequpath >> $scriptlog 2>&1139 makedir $trainsequpath 143 140 trainsequfile=$trainsequpath/sequence$firstruntrain.txt 144 echo "writing train sequfile "$trainsequfile >> $scriptlog 2>&1145 141 printprocesslog "INFO writing train sequencefile $trainsequfile" 146 142 … … 205 201 testno=`echo $firstruntest | cut -c 0-4` 206 202 testsequpath=$mcsequpath/$testno 207 makedir $testsequpath >> $scriptlog 2>&1203 makedir $testsequpath 208 204 testsequfile=$testsequpath/sequence$firstruntest.txt 209 echo "writing test sequfile "$testsequfile >> $scriptlog 2>&1210 205 printprocesslog "INFO writing test sequencefile $testsequfile" 211 206 … … 227 222 done 228 223 229 finish >> $scriptlog 2>&1230 224 finish 225 -
trunk/MagicSoft/Mars/datacenter/scripts/movingrawfiles
r9198 r9355 41 41 umask 0002 42 42 43 scriptlog=$runlogpath/$program-$datetime.log44 date >> $scriptlog 2>&145 46 43 # check whether script is already running 47 44 lockfile=$lockpath/lock-$program.txt 48 checklock >> $scriptlog 2>&145 checklock 49 46 50 47 # change permission for files 51 ssh tape@dc07 chmod -R g+w /magic/datacenter/fromtape/rawdata/* >> $scriptlog 2>&148 ssh tape@dc07 chmod -R g+w /magic/datacenter/fromtape/rawdata/* 52 49 53 50 # find rawfiles belonging to tape (don't move files not yet md5-sum checked) … … 56 53 if [ "$rawfiles" == "" ] 57 54 then 58 echo "no files to move -> exit" >> $scriptlog 2>&159 finish >> $scriptlog 2>&155 printprocesslog "INFO no files to move -> exit" 56 finish 60 57 fi 61 58 … … 75 72 newrawfile=`echo $rawfile | sed -e 's/\/fromtape\/muxdata//g' -e 's/_/\//1' -e 's/_/\//1'` 76 73 else 77 echo "ERROR something is wrong with the path of file $rawfile -> continue" >> $scriptlog 2>&178 74 printprocesslog "ERROR moving rawfile $rawfile failed" 79 75 continue … … 81 77 82 78 newdir=`dirname $newrawfile` 83 makedir $newdir >> $scriptlog 2>&179 makedir $newdir 84 80 85 mv -v $rawfile $newrawfile >> $scriptlog 2>&181 mv -v $rawfile $newrawfile 86 82 done 87 83 88 rmdir -v /magic/{datacenter,data/rawfiles}/fromtape/???data/* >> $scriptlog 2>&184 rmdir -v /magic/{datacenter,data/rawfiles}/fromtape/???data/* 89 85 90 86 printprocesslog "INFO launching filesondisk" 91 echo "launching filesondisk" >> $scriptlog 2>&192 87 $scriptspath/filesondisk & 93 88 94 finish >> $scriptlog 2>&189 finish -
trunk/MagicSoft/Mars/datacenter/scripts/movingrawfiles_OK
r8685 r9355 43 43 umask 0002 44 44 45 scriptlog=$runlogpath/$program-$datetime.log46 date >> $scriptlog 2>&147 48 45 # check whether script is already running 49 46 lockfile=$lockpath/lock-$program.txt 50 checklock >> $scriptlog 2>&147 checklock 51 48 52 49 # change permission for files 53 ssh tape@dc07 chmod -R g+w /magic/datacenter/fromtape/rawdata/* >> $scriptlog 2>&154 ssh lapalma@dc09 chmod -R g+w /magic/datacenter/fromlapalma/RAW*/ >> $scriptlog 2>&150 ssh tape@dc07 chmod -R g+w /magic/datacenter/fromtape/rawdata/* 51 ssh lapalma@dc09 chmod -R g+w /magic/datacenter/fromlapalma/RAW*/ 55 52 # output for chmod with -v or -c (only changes) 56 53 … … 61 58 then 62 59 # change permission for this directories 63 ssh lapalma@dc09 chmod -R g+w $dirs >> $scriptlog 2>&160 ssh lapalma@dc09 chmod -R g+w $dirs 64 61 # move directories to the tapedirectory 65 62 dates=`find /magic/datacenter/fromlapalma/RAW/*200* -type d | cut -d/ -f6` 66 63 for date in ${dates[@]} 67 64 do 68 ssh lapalma@dc09 mkdir /magic/datacenter/fromlapalma/RAWchk/$date >> $scriptlog 2>&169 makedir /magic/datacenter/fromtape/rawdata/$date >> $scriptlog 2>&165 ssh lapalma@dc09 mkdir /magic/datacenter/fromlapalma/RAWchk/$date 66 makedir /magic/datacenter/fromtape/rawdata/$date 70 67 71 68 OKs=`ls /magic/datacenter/fromlapalma/RAW/$date/*.OK` 72 69 for OK in ${OKs[@]} 73 70 do 74 ssh lapalma@dc09 mv -v $OK /magic/datacenter/fromlapalma/RAWchk/$date/ >> $scriptlog 2>&171 ssh lapalma@dc09 mv -v $OK /magic/datacenter/fromlapalma/RAWchk/$date/ 75 72 files=`echo $OK | sed -e 's/.OK//g'` 76 mv -v $files /magic/datacenter/fromtape/rawdata/$date/ >> $scriptlog 2>&173 mv -v $files /magic/datacenter/fromtape/rawdata/$date/ 77 74 done 78 75 done 79 76 fi 80 77 81 rmdir -v /magic/datacenter/fromlapalma/RAW/*200* >> $scriptlog 2>&178 rmdir -v /magic/datacenter/fromlapalma/RAW/*200* 82 79 83 80 # find rawfiles … … 86 83 if [ "$rawfiles" == "" ] 87 84 then 88 echo "no files to move -> exit" >> $scriptlog 2>&189 finish >> $scriptlog 2>&185 printprocesslog "INFO no files to move -> exit" 86 finish 90 87 fi 91 88 … … 97 94 newrawfile=`echo $rawfile | sed -e 's/center\/fromtape\/rawdata/\/rawfiles/g' -e 's/_/\//1' -e 's/_/\//1'` 98 95 newdir=`dirname $newrawfile` 99 makedir $newdir >> $scriptlog 2>&196 makedir $newdir 100 97 101 mv -v $rawfile $newrawfile >> $scriptlog 2>&198 mv -v $rawfile $newrawfile 102 99 done 103 100 104 rmdir -v /magic/datacenter/fromtape/rawdata/* >> $scriptlog 2>&1101 rmdir -v /magic/datacenter/fromtape/rawdata/* 105 102 106 103 printprocesslog "INFO launching filesondisk" 107 echo "launching filesondisk" >> $scriptlog 2>&1108 104 $scriptspath/filesondisk& 109 105 110 finish >> $scriptlog 2>&1106 finish 111 107 -
trunk/MagicSoft/Mars/datacenter/scripts/runcamera
r9174 r9355 63 63 64 64 65 scriptlog=$runlogpath/run$program-$datetime.log66 date >> $scriptlog 2>&167 68 65 # get sequence # 69 gettodo >> $scriptlog 2>&166 gettodo 70 67 run=$process 71 68 72 69 # lock sequ 73 70 lockfile=$lockpath/lock-$table-$column-$sequence.txt 74 checklock >> $scriptlog 2>&171 checklock 75 72 76 echo "run $program for run $run..." >> $scriptlog 2>&177 73 printprocesslog "INFO starting $program for run $run" 78 74 79 setstatus "start" >> $scriptlog 2>&175 setstatus "start" 80 76 81 echo "run $program for run $run " 82 echo "create input card... " 77 printprocesslog "INFO create input card... " 83 78 84 79 # get values for inputcard … … 100 95 seeds=`sendquery` 101 96 102 echo "" >> $scriptlog 2>&1103 echo "INPUTCARD:" >> $scriptlog 2>&1104 echo "----------" >> $scriptlog 2>&1105 echo "" >> $scriptlog 2>&1106 echo "" >> $scriptlog 2>&1107 printinputcard >> $scriptlog 2>&1108 109 97 logfile=$outpath/$program"-"`printf %06d $run`".log" 110 makedir $outpath >> $scriptlog 2>&198 makedir $outpath 111 99 112 100 cd $detectordir/Camera … … 121 109 122 110 case $check1 in 123 0) echo " check1=$check1 -> everything ok " >> $scriptlog 2>&1 124 printprocesslog "INFO $program finished successfully for sequence $sequence" 111 0) printprocesslog "INFO $program finished successfully for sequence $sequence (check1=$check1)" 125 112 ;; 126 *) echo " check1=$check1 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1 127 printprocesslog "ERROR $program failed for sequence $sequence" 113 *) printprocesslog "ERROR $program failed for sequence $sequence (check1=$check1)" 128 114 com=$Fcamera 129 115 check=$check1 … … 131 117 esac 132 118 133 setstatus "stop" >> $scriptlog 2>&1119 setstatus "stop" 134 120 135 finish >> $scriptlog 2>&1121 finish 136 122 -
trunk/MagicSoft/Mars/datacenter/scripts/runcorsika
r9347 r9355 111 111 112 112 113 scriptlog=$runlogpath/run$program-$datetime.log114 date >> $scriptlog 2>&1115 116 113 # get sequence # 117 gettodo "1" >> $scriptlog 2>&1114 gettodo "1" 118 115 run=${primaries[0]} 119 116 # get corsika runno … … 125 122 # lock sequ 126 123 lockfile=$lockpath/lock-$table-$column-$corsikarunno.txt 127 checklock >> $scriptlog 2>&1124 checklock 128 125 129 echo "run $program for run $run..." >> $scriptlog 2>&1130 126 printprocesslog "INFO starting $program for run $run" 131 127 132 setstatus "start" >> $scriptlog 2>&1128 setstatus "start" 133 129 134 echo "run $program for run $run " >> $scriptlog 2>&1 135 echo "create input card... " >> $scriptlog 2>&1 130 printprocesslog "INFO run $program for run $run " 131 printprocesslog "INFO create input card... " 136 132 137 133 # get values for inputcard … … 169 165 diameter=`sendquery` 170 166 171 echo "" >> $scriptlog 2>&1172 echo "INPUTCARD:" >> $scriptlog 2>&1173 echo "----------" >> $scriptlog 2>&1174 echo "" >> $scriptlog 2>&1175 echo "" >> $scriptlog 2>&1176 printinputcard >> $scriptlog 2>&1177 178 167 logfile=$outpath/$program"-"`printf %06d $corsikarunno`".log" 179 makedir $outpath >> $scriptlog 2>&1168 makedir $outpath 180 169 181 170 cd $corsikapath … … 192 181 193 182 case $check1 in 194 0) echo " check1=$check1 -> everything ok " >> $scriptlog 2>&1 195 printprocesslog "INFO $program finished successfully for corsika run number $corsikarunno" 183 0) printprocesslog "INFO $program finished successfully for corsika run number $corsikarunno (check1=$check1)" 196 184 ;; 197 *) echo " check1=$check1 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1 198 printprocesslog "ERROR $program failed for corsika run number $corsikarunno" 185 *) printprocesslog "ERROR $program failed for corsika run number $corsikarunno (check1=$check1)" 199 186 com=$Fcorsika 200 187 check=$check1 … … 202 189 esac 203 190 204 setstatus "stop" >> $scriptlog 2>&1191 setstatus "stop" 205 192 206 finish >> $scriptlog 2>&1193 finish 207 194 -
trunk/MagicSoft/Mars/datacenter/scripts/runreflector
r9173 r9355 59 59 } 60 60 61 62 scriptlog=$runlogpath/run$program-$datetime.log63 date >> $scriptlog 2>&164 65 61 # get sequence # 66 gettodo "1" >> $scriptlog 2>&162 gettodo "1" 67 63 run=${primaries[0]} 68 64 # get reflector runnumber … … 72 68 # lock sequ 73 69 lockfile=$lockpath/lock-$table-$column-$reflectorrunno.txt 74 checklock >> $scriptlog 2>&170 checklock 75 71 76 echo "run $program for run $run..." >> $scriptlog 2>&177 72 printprocesslog "INFO starting $program for run $run" 78 73 79 setstatus "start" >> $scriptlog 2>&174 setstatus "start" 80 75 81 echo "run $program for run $run " 82 echo "create input card... " 76 printprocesslog "INFO create input card... " 83 77 84 78 # get values for inputcard … … 100 94 infile=$mcpath"/corsika/"$date"/cer"`printf %06d \`sendquery\`` 101 95 102 echo "" >> $scriptlog 2>&1 103 echo "INPUTCARD:" >> $scriptlog 2>&1 104 echo "----------" >> $scriptlog 2>&1 105 echo "" >> $scriptlog 2>&1 106 echo "" >> $scriptlog 2>&1 107 printinputcard >> $scriptlog 2>&1 108 109 makedir $outpath >> $scriptlog 2>&1 96 makedir $outpath 110 97 if ls $outfile >/dev/null 2>&1 111 98 then … … 127 114 128 115 case $check1 in 129 0) echo " check1=$check1 -> everything ok " >> $scriptlog 2>&1 130 printprocesslog "INFO $program finished successfully for run $reflectorrunno" 116 0) printprocesslog "INFO $program finished successfully for run $reflectorrunno (check1=$check1)" 131 117 ;; 132 *) echo " check1=$check1 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1 133 printprocesslog "ERROR $program failed for run $reflectorrunno" 118 *) printprocesslog "ERROR $program failed for run $reflectorrunno (check1=$check1)" 134 119 com=$Freflector 135 120 check=$check1 … … 137 122 esac 138 123 139 setstatus "stop" >> $scriptlog 2>&1124 setstatus "stop" 140 125 141 finish >> $scriptlog 2>&1126 finish 142 127 -
trunk/MagicSoft/Mars/datacenter/scripts/sourcefile
r9221 r9355 60 60 rm -v $lockfile 61 61 fi 62 date63 62 exit 64 63 fi … … 90 89 rm -v $lockfile 91 90 fi 92 date93 91 printprocesslog "INFO finished $0" 94 92 exit … … 184 182 checklock0=$? 185 183 case $checklock0 in 186 0) echo " checklock0=$checklock0 -> continue " ;;187 1) echo " checklock0=$checklock0 -> file $lockfile exists"188 date184 0) printprocesslog "INFO checklock0=$checklock0 -> continue " 185 ;; 186 1) printprocesslog "WARN checklock0=$checklock0 -> file $lockfile exists" 189 187 $@ 190 188 exit;; 191 *) echo "checklock0=$checklock0 -> something went completely wrong" ;;189 *) printprocesslog "ERROR checklock0=$checklock0 -> something went completely wrong" ;; 192 190 esac 193 191 } … … 218 216 { 219 217 case $@ in 220 start) echo "setstatus start"218 start) printprocesslog "INFO setstatus start" 221 219 starttime="Now()" 222 220 ;; 223 221 stop) case $check in 224 ok) echo "setstatus stop - ok"222 ok) printprocesslog "INFO setstatus stop - ok" 225 223 statustime="Now()" 226 224 ;; 227 no) echo "setstatus stop - nothing new"225 no) printprocesslog "INFO setstatus stop - nothing new" 228 226 check="ok" 229 227 ;; 230 *) echo "setstatus stop - failed"228 *) printprocesslog "INFO setstatus stop - failed" 231 229 starttime=noreset 232 230 if [ "$check" == "" ] … … 242 240 esac 243 241 ;; 244 *) echo "error -> exit" 245 printprocesslog "ERROR function evalstatus got wrong variable" 242 *) printprocesslog "ERROR function evalstatus got wrong variable" 246 243 finish 247 244 ;; … … 279 276 { 280 277 process= 281 echo "getting todo..."278 printprocesslog "INFO getting todo..." 282 279 getdbsetup 283 280 getstepinfo … … 303 300 query=$query" limit 0, $@ " 304 301 fi 305 echo "QUERY: "$query302 printprocesslog "INFO QUERY: "$query 306 303 if ! process=`mysql -s -u $us --password=$pw --host=$ho $db -e " $query "` 307 304 then 308 echo "ERROR could not query processes from db -> exit"309 305 printprocesslog "ERROR could not query processes from db (program: $program, function gettodo)" 310 306 finish … … 313 309 if [ "$process" = "" ] 314 310 then 315 echo "=> nothing to do"311 printprocesslog "INFO => nothing to do" 316 312 finish 317 313 else … … 340 336 query=$query" and isnull(fStartTime) and isnull(fFailedTime) and isnull(fProgramId) and isnull(fReturnCode) " 341 337 query=$query" group by $column " 342 # echo "QUERY: "$query338 # printprocesslog "INFO QUERY: "$query 343 339 if ! numproc=`mysql -s -u $us --password=$pw --host=$ho $db -e " $query "` 344 340 then 345 echo "ERROR could not query number of todo proceses from db -> continue"346 341 printprocesslog "ERROR could not query number of processes from db (program: $program, function getstatus)" 347 342 cont … … 364 359 if [ "$reset" = "no" ] 365 360 then 366 echo "YOU CAN'T RESET $column for ${primaries[$s+$s]}!!!" 367 printprocesslog "ERROR you can't reset $column for ${primaries[$s+$s]}" 361 printprocesslog "ERROR You cannot reset $column for ${primaries[$s+$s]}" 368 362 finish 369 363 fi … … 391 385 query=$query" and ${prims[$i]}='${primaries[$s*${#prims[@]}+$i]}' " 392 386 done 393 echo "QUERY: "$query387 printprocesslog "INFO QUERY: "$query 394 388 if ! mysql -s -u $us --password=$pw --host=$ho $db -e " $query " 395 389 then 396 echo "ERROR could not insert status into db -> exit"397 390 printprocesslog "ERROR could not set status in db (program: $program, function setstatus)" 398 391 finish -
trunk/MagicSoft/Mars/datacenter/scripts/writedatasetfiles
r9113 r9355 41 41 column=fDataSetFileWritten 42 42 43 scriptlog=$runlogpath/$program-$datetime.log44 date >> $scriptlog 2>&145 46 43 # check if script is already running 47 44 lockfile=$lockpath/lock-$program.txt 48 checklock >> $scriptlog 2>&145 checklock 49 46 50 47 # get todo list 51 gettodo >> $scriptlog 2>&148 gettodo 52 49 53 50 cd $mars … … 56 53 do 57 54 dataset=${primaries[$s]} 58 echo "writing dataset file for dataset $dataset..." >> $scriptlog 2>&159 55 printprocesslog "INFO writing datasetfile for dataset $dataset" 60 56 no=`printf %08d $dataset | cut -c 0-5` 61 57 no2=`printf %08d $dataset` 62 58 datasetpathcpl=$datasetpath/$no 63 makedir $datasetpathcpl >> $scriptlog 2>&159 makedir $datasetpathcpl 64 60 writedatasetfilelogpath=$logpath/$program/$no 65 makedir $writedatasetfilelogpath >> $scriptlog 2>&161 makedir $writedatasetfilelogpath 66 62 logfile=$writedatasetfilelogpath/$program-$no2.log 67 63 68 setstatus "start" >> $scriptlog 2>&164 setstatus "start" 69 65 70 66 check1=`root -q -b $macrospath/writedatasetfile.C+\($dataset\,\""$datasetpathcpl\""\) | tee $logfile | intgrep` 71 67 72 68 case $check1 in 73 1) echo " check1=$check1 -> everything ok" >> $scriptlog 2>&1 74 printprocesslog "INFO wrote datasetfile for dataset $dataset successfully" 69 1) printprocesslog "INFO wrote datasetfile for dataset $dataset successfully (check1=$check1)" 75 70 ;; 76 0) echo " check1=$check1 -> no connection to db -> continue..." >> $scriptlog 2>&1 77 printprocesslog "WARN connection to DB failed" 71 0) printprocesslog "WARN connection to DB failed (check1=$check1)" 78 72 check="no" 79 73 ;; 80 *) echo " check1=$check1 -> ERROR " >> $scriptlog 2>&1 81 printprocesslog "ERROR writedatasetfile.C failed" 74 *) printprocesslog "ERROR writedatasetfile.C failed (check1=$check1)" 82 75 com=$Fwritedatasetfile 83 76 check=$check1 … … 85 78 esac 86 79 87 setstatus "stop" >> $scriptlog 2>&180 setstatus "stop" 88 81 done 89 82 90 finish >> $scriptlog 2>&183 finish 91 84 -
trunk/MagicSoft/Mars/datacenter/scripts/writesequencefiles
r9054 r9355 42 42 set -C 43 43 44 scriptlog=$runlogpath/$program-$datetime.log45 date >> $scriptlog 2>&146 47 44 # check if script is already running 48 45 lockfile=$lockpath/lock-$program.txt 49 checklock >> $scriptlog 2>&146 checklock 50 47 51 48 # get todo list 52 gettodo >> $scriptlog 2>&149 gettodo 53 50 54 51 cd $mars … … 63 60 no2=`printf %08d $sequence` 64 61 sequencepath=$sequpath/$no 65 makedir $sequencepath >> $scriptlog 2>&162 makedir $sequencepath 66 63 67 64 writesequencefilelogpath=$logpath/$program/$no 68 makedir $writesequencefilelogpath >> $scriptlog 2>&165 makedir $writesequencefilelogpath 69 66 writesequencefilelog=$writesequencefilelogpath/writesequencefile-$no2.log 70 67 71 echo "write sequencefile for sequence $sequence" >> $scriptlog 2>&1 72 setstatus "start" >> $scriptlog 2>&1 68 setstatus "start" 73 69 74 check2=`root -q -b $macrospath/writesequencefile.C\($sequence\,$telnum\,"\"$sequpath\""\) | tee $writesequencefilelog | intgrep` 75 case $check2 in 76 1) echo " check2=$check2 -> everything ok " >> $scriptlog 2>&1 77 printprocesslog "INFO sequence file successfully written for sequence $sequence" 70 check1=`root -q -b $macrospath/writesequencefile.C\($sequence\,$telnum\,"\"$sequpath\""\) | tee $writesequencefilelog | intgrep` 71 case $check1 in 72 1) printprocesslog "INFO sequence file successfully written for sequence $sequence (check1=$check1)" 78 73 ;; 79 0) echo " check2=$check2 -> no connection to db -> continue..." >> $scriptlog 2>&1 80 printprocesslog "WARN connection to DB failed" 74 0) printprocesslog "WARN connection to DB failed (check1=$check1)" 81 75 check="no" 82 76 ;; 83 *) echo " check2=$check2 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1 84 printprocesslog "ERROR $program.C failed for sequence $sequence" 77 *) printprocesslog "ERROR $program.C failed for sequence $sequence (check1=$check1)" 85 78 com=$Fwritesequfile 86 check=$check 279 check=$check1 87 80 ;; 88 81 esac 89 82 90 setstatus "stop" >> $scriptlog 2>&183 setstatus "stop" 91 84 done 92 85 93 finish >> $scriptlog 2>&186 finish 94 87
Note:
See TracChangeset
for help on using the changeset viewer.