Skip to content

Commit

Permalink
Merge pull request #9 from venturia/tkdbmonitoring_70x
Browse files Browse the repository at this point in the history
Merge tkdbmonitoring_70x into tkdbmonitoring_71x
  • Loading branch information
venturia committed Mar 25, 2014
2 parents 3a455b5 + 5a4ca66 commit d723004
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 26 deletions.
25 changes: 18 additions & 7 deletions DQM/SiStripMonitorSummary/scripts/Monitor_GlobalTags.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,18 @@ for globaltag in `cat $GLOBALTAGCOLLECTION`; do
afstokenchecker.sh "Processing Global Tag $globaltag";

if [ -d "$STORAGEPATH/$DB/$GLOBALTAGDIR/$globaltag" ]; then
# afstokenchecker.sh "Directory $STORAGEPATH/$DB/$GLOBALTAGDIR/$globaltag exists already";
# already known GT will not be reprocessed. The directory has to be deleted to reprocess a GT
continue
# already known GT: check if the directory is empty otherwise skip it
NOTONLYNOISERATIOS=false
for file in `ls $STORAGEPATH/$DB/$GLOBALTAGDIR/$globaltag/`; do
if [ $file != "NoiseRatios" ] && [ $file != "RunInfo" ]; then
NOTONLYNOISERATIOS=true
continue
fi
done
if [ "$NOTONLYNOISERATIOS" == "true" ]; then
continue
fi
afstokenchecker.sh "Directory $STORAGEPATH/$DB/$GLOBALTAGDIR/$globaltag contains only NoiseRatios: to be processed";
else
afstokenchecker.sh "Creating directory $STORAGEPATH/$DB/$GLOBALTAGDIR/$globaltag";
mkdir $STORAGEPATH/$DB/$GLOBALTAGDIR/$globaltag;
Expand All @@ -69,7 +78,8 @@ for globaltag in `cat $GLOBALTAGCOLLECTION`; do
TAG=`echo $tagstring | awk '{print $1}' | sed -e "s@tag:@@g"`
RECORD=`echo $tagstring | awk '{print $2}' | sed -e "s@record:@@g"`
OBJECT=`echo $tagstring | awk '{print $3}' | sed -e "s@object:@@g"`
ACCOUNT=`echo $tagstring | awk '{print $4}' | sed -e "s@pfn:frontier://$FRONTIER/@@g"`
# ACCOUNT=`echo $tagstring | awk '{print $4}' | sed -e "s@pfn:frontier://$FRONTIER/@@g"`
ACCOUNT=`echo $tagstring | awk '{print $4}' | awk 'BEGIN {FS = "/" } ; { print $NF }'`
TAGSUBDIR="Unknown"

if [ `echo $TAG | grep "Noise" | wc -w` -gt 0 ]; then
Expand Down Expand Up @@ -120,7 +130,8 @@ for globaltag in `cat $GLOBALTAGCOLLECTION`; do

# Creation of links between the DB-Tag and the respective Global Tags
if [ ! -d "$STORAGEPATH/$DB/$ACCOUNT/$DBTAGDIR/$TAGSUBDIR/$TAG" ]; then
afstokenchecker.sh "tag $TAG is unknown: skipped";
afstokenchecker.sh "Tag $TAG is unknown: skipped";
echo "$tagstring";
continue
fi
if [ ! -d "$STORAGEPATH/$DB/$ACCOUNT/$DBTAGDIR/$TAGSUBDIR/$TAG/RelatedGlobalTags" ]; then
Expand All @@ -135,8 +146,8 @@ for globaltag in `cat $GLOBALTAGCOLLECTION`; do
RECORDANDOBJECTNAME="Record name: $RECORD Object Name: $OBJECT"
echo $RECORDANDOBJECTNAME

rm -f $tag;
cat >> $tag << EOF
rm -f $TAG;
cat >> $TAG << EOF
<html>
<body>
<a href="https://test-stripdbmonitor.web.cern.ch/test-stripdbmonitor/CondDBMonitoring/$DB/$ACCOUNT/$DBTAGDIR/$TAGSUBDIR/$TAG">https://test-stripdbmonitor.web.cern.ch/test-stripdbmonitor/CondDBMonitoring/$DB/$ACCOUNT/$DBTAGDIR/$TAGSUBDIR/$TAG</a>
Expand Down
40 changes: 21 additions & 19 deletions DQM/SiStripMonitorSummary/scripts/Monitor_RunInfo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -140,41 +140,43 @@ for globaltag in `cat $GLOBALTAGCOLLECTION`; do
fi

# Creation of Global Tag directory if not existing yet
if [ ! -d "$STORAGEPATH/$DB/$ACCOUNT/$GLOBALTAGDIR" ]; then
afstokenchecker.sh "Creating directory $STORAGEPATH/$DB/$ACCOUNT/$GLOBALTAGDIR"
mkdir $STORAGEPATH/$DB/$ACCOUNT/$GLOBALTAGDIR;
if [ ! -d "$STORAGEPATH/$DB/$GLOBALTAGDIR" ]; then
afstokenchecker.sh "Creating directory $STORAGEPATH/$DB/$GLOBALTAGDIR"
mkdir $STORAGEPATH/$DB/$GLOBALTAGDIR;
fi

if [ ! -d "$STORAGEPATH/$DB/$ACCOUNT/$GLOBALTAGDIR/$globaltag" ]; then
afstokenchecker.sh "Creating directory $STORAGEPATH/$DB/$ACCOUNT/$GLOBALTAGDIR/$globaltag"
mkdir $STORAGEPATH/$DB/$ACCOUNT/$GLOBALTAGDIR/$globaltag;
if [ ! -d "$STORAGEPATH/$DB/$GLOBALTAGDIR/$globaltag" ]; then
afstokenchecker.sh "Creating directory $STORAGEPATH/$DB/$GLOBALTAGDIR/$globaltag"
mkdir $STORAGEPATH/$DB/$GLOBALTAGDIR/$globaltag;
fi

# Creation of links between the DB-Tag and the respective Global Tags
cd $STORAGEPATH/$DB/$ACCOUNT/$GLOBALTAGDIR/$globaltag;
if [ -f $tag ]; then
rm $tag;
if [ ! -d "$STORAGEPATH/$DB/$GLOBALTAGDIR/$globaltag/RunInfo" ]; then
afstokenchecker.sh "Creating directory $STORAGEPATH/$DB/$GLOBALTAGDIR/$globaltag/RunInfo"
mkdir $STORAGEPATH/$DB/$GLOBALTAGDIR/$globaltag/RunInfo;
fi
cat >> $tag << EOF

# Creation of links between the DB-Tag and the respective Global Tags
if [ ! -f $STORAGEPATH/$DB/$GLOBALTAGDIR/$globaltag/RunInfo/$tag ] || [ ! -f $STORAGEPATH/$DB/$ACCOUNT/$DBTAGDIR/$TAGSUBDIR/$tag/RelatedGlobalTags/$globaltag ]; then
cd $STORAGEPATH/$DB/$GLOBALTAGDIR/$globaltag/RunInfo;
rm -f $tag;
cat >> $tag << EOF
<html>
<body>
<a href="https://test-stripdbmonitor.web.cern.ch/test-stripdbmonitor/CondDBMonitoring/$DB/$ACCOUNT/$DBTAGDIR/$TAGSUBDIR/$tag">https://test-stripdbmonitor.web.cern.ch/test-stripdbmonitor/CondDBMonitoring/$DB/$ACCOUNT/$DBTAGDIR/$TAGSUBDIR/$tag</a>
</body>
</html>
EOF
#ln -s $STORAGEPATH/$DB/$ACCOUNT/$DBTAGDIR/$TAGSUBDIR/$tag $tag;
cd $STORAGEPATH/$DB/$ACCOUNT/$DBTAGDIR/$TAGSUBDIR/$tag/RelatedGlobalTags;
if [ -f $globaltag ]; then
rm $globaltag;
fi
cat >> $globaltag << EOF

cd $STORAGEPATH/$DB/$ACCOUNT/$DBTAGDIR/$TAGSUBDIR/$tag/RelatedGlobalTags;
rm -f $globaltag;
cat >> $globaltag << EOF
<html>
<body>
<a href="https://test-stripdbmonitor.web.cern.ch/test-stripdbmonitor/CondDBMonitoring/$DB/$ACCOUNT/$GLOBALTAGDIR/$globaltag">https://test-stripdbmonitor.web.cern.ch/test-stripdbmonitor/CondDBMonitoring/$DB/$ACCOUNT/$GLOBALTAGDIR/$globaltag</a>
<a href="https://test-stripdbmonitor.web.cern.ch/test-stripdbmonitor/CondDBMonitoring/$DB/$GLOBALTAGDIR/$globaltag">https://test-stripdbmonitor.web.cern.ch/test-stripdbmonitor/CondDBMonitoring/$DB/$GLOBALTAGDIR/$globaltag</a>
</body>
</html>
EOF
#ln -s $STORAGEPATH/$DB/$ACCOUNT/$GLOBALTAGDIR/$globaltag $globaltag;

cd $WORKDIR;

# check if the tag has been analyzed already
Expand Down

0 comments on commit d723004

Please sign in to comment.