Changeset 8482 for trunk/MagicSoft/Mars/datacenter/scripts/filesondisk
- Timestamp:
- 05/09/07 17:05:15 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/datacenter/scripts/filesondisk
r8410 r8482 20 20 # Author(s): Daniela Dorner 08/2004 <mailto:dorner@astro.uni-wuerzburg.de> 21 21 # 22 # Copyright: MAGIC Software Development, 2000-200 622 # Copyright: MAGIC Software Development, 2000-2007 23 23 # 24 24 # … … 33 33 # this includes also the search for missing cacofiles: 34 34 # Sometimes the DAQ aborts a run and starts itself a new one. In this 35 # cases the camera control ldoesn't start a new file, as the command to35 # cases the camera control doesn't start a new file, as the command to 36 36 # start a new run was not sent by the central control. So the caco 37 37 # information is stored in the previous caco file, which has a … … 40 40 # information has to be found. 41 41 # In this script the search and inserting into the database is done 42 # using the macro s findcacofiles.C and insertcacofile.C42 # using the macro findcacofiles.C 43 43 # - rawfiles 44 44 # The update in the database is done using the macro resetallruns.C … … 66 66 printprocesslog "INFO checking ccfiles" 67 67 filename=$filesondisklogpath/ccfilesondisk-$datetime.txt 68 if ls $filename >/dev/null 2>&1 69 then 70 rm -v $filename >> $scriptlog 2>&1 71 fi 68 72 column=fCCFileAvail 69 73 find $subsystempath/cc/ -name '*_S.rep' | cut -d_ -f2 > $filename … … 85 89 86 90 91 87 92 echo "checking disk for cacofiles..." >> $scriptlog 2>&1 88 93 printprocesslog "INFO checking cacofiles" 89 94 filename=$filesondisklogpath/cacofilesondisk-$datetime.txt 95 if ls $filename >/dev/null 2>&1 96 then 97 rm -v $filename >> $scriptlog 2>&1 98 fi 90 99 column=fCaCoFileAvail 91 100 find $subsystempath/caco/ -name '*.txt' | cut -d_ -f8 | grep [0-9] > $filename … … 107 116 108 117 date=`date +%F` 109 echo " checking missing cacofiles..." >> $scriptlog 2>&1118 echo "finding missing cacofiles..." >> $scriptlog 2>&1 110 119 printprocesslog "INFO checking missing cacofiles" 111 check1=`root -q -b $macrospath/findcacofiles.C+ \("\"$date\""\,"\"$filesondisklogpath\""\)| tee $filesondisklogpath/findcacofiles-$datetime.log | intgrep`120 check1=`root -q -b $macrospath/findcacofiles.C+ | tee $filesondisklogpath/findcacofiles-$datetime.log | intgrep` 112 121 113 122 case $check1 in … … 123 132 esac 124 133 125 printprocesslog "INFO finding missing cacofiles"126 missingcacoruns=(`cat $filesondisklogpath/findcacofiles-$date.txt`)127 for missingcacorun in ${missingcacoruns[@]}128 do129 runno=$missingcacorun130 echo "missing cacofile for run "$runno >> $scriptlog 2>&1131 echo "-> finding cacofile" >> $scriptlog 2>&1132 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 -and ! -name [2][0][0-2][0-9][0,1][0-9][0-3][0-9]_*[1-9]${runno}_[P,D,C,S]_*_S.rep` 2>/dev/null133 echo " ccfile: "$ccfile >> $scriptlog 2>&1134 if [ "$ccfile" = "" ]135 then136 echo " no ccfile found for run "$runno >> $scriptlog 2>&1137 continue138 fi139 for (( i = 0; i <= 10; i++ ))140 do141 newrun=`echo $runno - $i | bc`142 path=`dirname $ccfile`143 path=`echo $path | sed -e 's/cc/caco/'`144 cacofile=`find $path -name *$newrun* 2>/dev/null`145 if [ "$cacofile" = "" ]146 then147 continue148 else149 printprocesslog "INFO inserting cacofile for run $missingcacorun"150 echo " inserting cacofile $file for run $missingcacorun..." >> $scriptlog 2>&1151 check2=`root -q -b $macrospath/insertcacofile.C+\("\"$runno\""\,"\"$newrun\""\) | tee $filesondisklogpath/insertcacofile-$missingcacorun.log | intgrep`152 153 case $check2 in154 1) echo " check2=$check2 -> everything ok -> insert is done" >> $scriptlog 2>&1155 printprocesslog "INFO inserted $missingcacorun successfully"156 ;;157 0) echo " check1=$check1 -> no connection to db -> continue..." >> $scriptlog 2>&1158 printprocesslog "WARN connection to DB failed"159 ;;160 *) echo " check2=$check2 -> ERROR -> something went wrong while inserting run "$missingcacorun >> $scriptlog 2>&1161 printprocesslog "ERROR insertcacofile.C failed for run $missingcacorun"162 ;;163 esac164 break165 fi166 done167 if [ "$cacofile" = "" ]168 then169 echo " no cacofile found for run "$runno >> $scriptlog 2>&1170 printprocesslog "WARN no cacofile found for run $runno"171 else172 echo " cacofile: "$cacofile >> $scriptlog 2>&1173 fi174 done175 134 176 135 … … 178 137 printprocesslog "INFO checking rawfiles" 179 138 filename=$filesondisklogpath/rawfilesondisk-$datetime.txt 139 if ls $filename >/dev/null 2>&1 140 then 141 rm -v $filename >> $scriptlog 2>&1 142 fi 180 143 column=fRawFileAvail 181 144 find $datapath/rawfiles -name '*.raw' -o -name '*.gz' | cut -d_ -f2 > $filename
Note:
See TracChangeset
for help on using the changeset viewer.