Changeset 7051 for trunk/MagicSoft/Mars/datacenter/scripts/insertdatasets
- Timestamp:
- 05/17/05 16:53:35 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/datacenter/scripts/insertdatasets
r7037 r7051 36 36 cd /home/operator/Mars.cvs 37 37 38 datetime=`date +%F-%H-%M-%S` 39 year=`date +%Y` 40 41 scriptlogpath=$logpath/run/insertdatasets/`date +%Y/%m` 42 if [ ! -d $scriptlogpath ] 43 then 44 mkdir -pv $scriptlogpath 45 if [ ! -d $scriptlogpath ] 46 then 47 echo "could not make scriptlogpath "$scriptlogpath 48 exit 49 fi 50 fi 51 52 scriptlog=$scriptlogpath/insertdatasets-$datetime.log 53 54 date >> $scriptlog 2>&1 55 56 date > $lockpath/lock-insertdatasets.txt >> $scriptlog 2>&1 57 checklock0=$? 58 case $checklock0 in 59 0) echo "checklock0=$checklock0 -> continue " >> $scriptlog 2>&1;; 60 1) echo "checklock0=$checklock0 -> file exists " >> $scriptlog 2>&1 61 echo "-> getting list for callisto is running -> exit" >> $scriptlog 2>&1 62 date >> $scriptlog 2>&1 63 exit;; 64 *) echo "checklock0=$checklock0 -> something went completely wrong" >> $scriptlog 2>&1;; 65 esac 66 38 67 39 68 datasetfiles=(`ls /magic/datasets/*/*`) 40 echo "datasetfiles: "${datasetfiles[@]} 41 echo "" 69 echo "datasetfiles: "${datasetfiles[@]} >> $scriptlog 2>&1 70 echo "" >> $scriptlog 2>&1 42 71 43 72 for datasetfile in ${datasetfiles[@]} … … 48 77 if [ "$no" = "$no3" ] 49 78 then 50 echo "number in filename and in file are the same -> continue" 79 echo "number in filename and in file are the same -> continue" >> $scriptlog 2>&1 51 80 else 52 echo "number in filename and in file are not the same " 53 echo " -> continue with next dataset" 81 echo "number in filename and in file are not the same " >> $scriptlog 2>&1 82 echo " -> continue with next dataset" >> $scriptlog 2>&1 54 83 continue 55 84 fi 56 source=`grep 'SourceName:' $datasetfile | sed -e 's/SourceName://g' | sed -e 's/ //g' | sed -e 's/#//g'` 57 mode=`grep 'WobbleMode:' $datasetfile` 58 mode2=`echo $mode | grep ^\#` 85 source=`grep 'SourceName:' $datasetfile | sed -e 's/SourceName://g' | sed -e 's/ //g' | sed -e 's/#//g'` >> $scriptlog 2>&1 86 mode=`grep 'WobbleMode:' $datasetfile` >> $scriptlog 2>&1 87 mode2=`echo $mode | grep ^\#` >> $scriptlog 2>&1 59 88 if [ "$mode2" = "" ] 60 89 then 61 wobble="Y" 90 wobble="Y" >> $scriptlog 2>&1 62 91 else 63 wobble="N" 92 wobble="N" >> $scriptlog 2>&1 64 93 fi 65 echo "file: "$datasetfile 66 echo " datasetno: "$no2 67 echo " sourcename: "$source 68 echo " wobble: "$wobble 69 echo " " 70 # check0=`root -q -b $macrospath/insertdataset.C+\("\"$no\""\,"\"$source\""\,"\"$type\""\) | tee $insertdatasetlog | grep int | sed -e 's/(int)//'` 71 check0=`root -q -b $macrospath/insertdataset.C+\("\"$no2\""\,"\"$source\""\,"\"$wobble\"",kFALSE\) | grep int | sed -e 's/(int)//'` 94 echo "file: "$datasetfile >> $scriptlog 2>&1 95 echo " datasetno: "$no2 >> $scriptlog 2>&1 96 echo " sourcename: "$source >> $scriptlog 2>&1 97 echo " wobble: "$wobble >> $scriptlog 2>&1 98 echo " " >> $scriptlog 2>&1 99 100 insertdatasetpath=$logpath/insertdataset/$no3 101 if [ ! -d $insertdatasetpath ] 102 then 103 mkdir -pv $insertdatasetpath >> $scriptlog 2>&1 104 if [ ! -d $insertdatasetpath ] 105 then 106 echo "could not make insertdatasetpath "$insertdatasetpath >> $scriptlog 2>&1 107 continue 108 fi 109 fi 110 insertdatasetlog=$insertdatasetpath/insertdataset-$no3.log 111 check0=`root -q -b $macrospath/insertdataset.C+\("\"$no2\""\,"\"$source\""\,"\"$wobble\"",kFALSE\) | tee $insertdatasetlog | grep int | sed -e 's/(int)//'` 72 112 case $check0 in 73 1) echo "check0=$check0 -> everthing ok " ;;74 *) echo "check0=$check0 -> ERROR " ;;113 1) echo "check0=$check0 -> everthing ok " >> $scriptlog 2>&1 ;; 114 *) echo "check0=$check0 -> ERROR " >> $scriptlog 2>&1 ;; 75 115 esac 76 116 done 77 117 118 rm -v $todofile >> $scriptlog 2>&1 119 rm -v $lockpath/lock-insertdatasets.txt >> $scriptlog 2>&1 78 120 121 set +C 122 123 date >> $scriptlog 2>&1 124 125
Note:
See TracChangeset
for help on using the changeset viewer.