ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitProd/Processing/bin/status.sh
Revision: 1.2
Committed: Sat Mar 19 01:49:13 2011 UTC (14 years, 1 month ago) by paus
Content type: application/x-sh
Branch: MAIN
CVS Tags: Mit_023, Mit_022a, Mit_022, Mit_020d, TMit_020d, Mit_020c, Mit_021, Mit_021pre2, Mit_021pre1, Mit_020b, Mit_020a, Mit_020
Changes since 1.1: +15 -2 lines
Log Message:
Small updates here and there.

File Contents

# Content
1 #!/bin/bash
2 #---------------------------------------------------------------------------------------------------
3 # Determining the status of a given production sample
4 #---------------------------------------------------------------------------------------------------
5 H=`basename $0`
6
7 BOOK=$1
8 DATASET=$2
9 PRINTOPT=$3
10
11 if [ "$PRINTOPT" == "-header" ]
12 then
13 printf "%s\n" 'BOOK SAMPLE All Done( T3) ToDo'
14 printf "%s\n" '--------------------------------------------------------------------------'
15 fi
16
17 DIR=/pnfs/cmsaf.mit.edu/t2bat/cms/store/user/paus/$BOOK
18 T3DIR=/mnt/hadoop/cmsprod/$BOOK
19 if [ "`list $DIR | grep $DATASET`" != "" ]
20 then
21 nAll=`wc -l $BOOK/$DATASET.lfns | cut -d ' ' -f 1`
22 # how many are done on the Tier-2
23 nDone=`list $DIR/$DATASET | grep root | wc -l`
24 # how many are available on the Tier-3
25 nDoneT3=`list $T3DIR/$DATASET 2> /dev/null | grep root | wc -l`
26 nMissing=$(( ${nAll}-${nDone} ))
27
28 nEvents=`cat $BOOK/$DATASET.lfns | awk '{n=n+$3} END {print n}'`
29 size=`list $DIR/$DATASET | grep root | awk '{s=s+$1} END {print s/1024./1024./1024.}'`
30 sizePerEvent=`echo $nEvents $size | awk '{print $2*1024*1024/$1}'`
31 printf "%-14s %-30s %6d %6d(%6d) %6d Evts: %12d in %8.2f GB (%5.1f kB/evt)\n" \
32 $BOOK $DATASET $nAll $nDone $nDoneT3 $nMissing $nEvents $size $sizePerEvent
33
34
35 fi
36
37 exit 0