Changeset 9114 for trunk/MagicSoft/Mars/datacenter/scripts/zipscript
- Timestamp:
- 08/12/08 10:20:17 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/datacenter/scripts/zipscript
r9093 r9114 19 19 # 20 20 # Author(s): Daniela Dorner 09/2006 <mailto:dorner@astro.uni-wuerzburg.de> 21 # Author(s): Stefan Ruegamer 08/2008 <mailto:snruegam@astro.uni-wuerzburg.de> 21 22 # 22 23 # Copyright: MAGIC Software Development, 2000-2007 … … 55 56 for file in ${files[@]} 56 57 do 57 echo "processing file $file..." >> $scriptlog 2>&1 58 if ! [ -f $file ] 59 then 60 continue 61 fi 62 63 echo -e "\nprocessing file $file..." >> $scriptlog 2>&1 58 64 runno=`basename $file | sed -e 's/.*20[01][0-9]\{5\}_\(M[12]_\)\?.*\([0-9]\{8\}\).\([0-9]\{3\}\)\?.*/\2/'` 59 65 fileno=`basename $file | sed -e 's/.*20[01][0-9]\{5\}_\(M[12]_\)\?.*\([0-9]\{8\}\).\([0-9]\{3\}\)\?.*/\3/'` … … 69 75 telno=1 70 76 fi 77 78 # get the sequence corresponding to the run 71 79 query="SELECT fSequenceFirst FROM RunData WHERE fRunNumber="$runno" AND fFileNumber="$fileno" AND fTelescopeNumber="$telno 72 echo " sending query: $query" >> $scriptlog 2>&1 80 echo " sending query: $query" >> $scriptlog 2>&1 73 81 if ! seq=`sendquery` 74 82 then 75 echo "querying seq for run M _${telno}${runno}.${fileno} from the db did not work -> continue" >> $scriptlog 2>&176 printprocesslog "WARN query $seq for run M _${telno}${runno}.${fileno} from the db did not work"83 echo "querying seq for run M${telno}_${runno}.${fileno} from the db did not work -> continue" >> $scriptlog 2>&1 84 printprocesslog "WARN query $seq for run M${telno}_${runno}.${fileno} from the db did not work" 77 85 continue 78 86 fi 79 if [ "$seq" == "" ] 87 if [ "$seq" == "" ] || [ "$seq" == "0" ] 80 88 then 81 echo "no seq found for run M _${telno}${runno}.${fileno} -> locking only run..." >> $scriptlog 2>&182 seq=$ runno89 echo "no seq found for run M${telno}_${runno}.${fileno} -> locking only run..." >> $scriptlog 2>&1 90 seq=${runno}.${fileno} 83 91 fi 84 echo "locking sequence $seq..." >> $scriptlog 2>&1 92 93 # lock the sequence against zipscript 94 echo "locking sequence ${seq}-${telno}..." >> $scriptlog 2>&1 85 95 lockfile=$lockpath/calzip${seq}-${telno}.txt 86 96 checklock continue >> $scriptlog 2>&1 87 query="UPDATE SequenceProcessStatus set fNotZipping=NULL WHERE fSequenceFirst=$seq" 88 echo " sending query: $query" >> $scriptlog 2>&1 97 98 # lock the run in the db 99 query="UPDATE SequenceProcessStatus set fNotZipping=NULL WHERE fSequenceFirst=$seq AND fTelescopeNumber=$telno" 100 echo " sending query: $query" >> $scriptlog 2>&1 89 101 if ! sendquery 90 102 then 91 echo "locking $ seqfor callisto in db did not work ..." >> $scriptlog 2>&192 printprocesslog "WARN locking $ seqfor callisto in db did not work"103 echo "locking ${seq}-${telno} for callisto in db did not work ..." >> $scriptlog 2>&1 104 printprocesslog "WARN locking ${seq}-${telno} for callisto in db did not work" 93 105 rm -v $lockfile >> $scriptlog 2>&1 94 106 continue 95 107 fi 108 109 # zip the run 96 110 echo "zipping $file ..." >> $scriptlog 2>&1 97 111 if ssh -xn phoenix nice -n 19 gzip -1f $file >> $scriptlog 2>&1 … … 102 116 printprocesslog "WARN zipping $file did not work" 103 117 fi 104 echo "unlocking sequence $seq..." >> $scriptlog 2>&1 105 query="UPDATE SequenceProcessStatus set fNotZipping=Now() WHERE fSequenceFirst=$seq" 106 echo " sending query: $query" >> $scriptlog 2>&1 118 119 # unlock the sequence in the db 120 echo "unlocking sequence ${seq}-${telno}..." >> $scriptlog 2>&1 121 query="UPDATE SequenceProcessStatus set fNotZipping=Now() WHERE fSequenceFirst=$seq AND fTelescopeNumber=$telno" 122 echo " sending query: $query" >> $scriptlog 2>&1 107 123 if ! sendquery 108 124 then 109 echo "unlocking $ seqfor callisto in db did not work ..." >> $scriptlog 2>&1110 printprocesslog "ERROR unlocking $ seqfor callisto in db did not work"125 echo "unlocking ${seq}-${telno} for callisto in db did not work ..." >> $scriptlog 2>&1 126 printprocesslog "ERROR unlocking ${seq}-${telno} for callisto in db did not work" 111 127 rm -v $lockfile >> $scriptlog 2>&1 112 128 continue
Note:
See TracChangeset
for help on using the changeset viewer.