Changeset 9355 for trunk/MagicSoft/Mars/datacenter/scripts/insertdatasets
- Timestamp:
- 02/19/09 21:22:19 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note:
See TracChangeset
for help on using the changeset viewer.