MakeNearlineWebPlots.sh
Go to the documentation of this file.
1 #!/bin/bash
2 
3 #
4 # Make plots for the Nearline webpage...
5 #
6 
7 args=("$@")
8 argssize=${#args[*]}
9 if [ $argssize -ne 3 ];then
10  echo ""
11  echo "Usage: ./MakeNearlineWebPlots.sh {dunetpc release: vXX_YY_ZZ} {compiler} {time period in days}"
12  echo ""
13  echo "Example: ./MakeNearlineWebPlots.sh v04_32_01 e9 2"
14  echo ""
15  exit
16 fi
17 
18 REL=${args[0]}
19 COMP=${args[1]}
20 DAYS=${args[2]}
21 
22 
23 
24 # Test to see if this job is already running.
25 if [ -e /tmp/Batch-MakeNearlineWebPlots-${REL}-${DAYS}days.lock ];then
26  echo "lock file /tmp/Batch-MakeNearlineWebPlots-${REL}-${DAYS}days.lock exists. Exiting..."
27  exit
28 fi
29 touch /tmp/Batch-MakeNearlineWebPlots-${REL}-${DAYS}days.lock
30 
31 
32 
33 # Get a ticket.
34 KEYTAB=/var/adm/krb5/lbnedaq.keytab
35 KEYUSE=`/usr/krb5/bin/klist -k ${KEYTAB} | grep FNAL.GOV | head -1 | cut -c 5- | cut -f 1 -d /`
36 /usr/krb5/bin/kinit -5 -A -kt ${KEYTAB} ${KEYUSE}/dune/`hostname`@FNAL.GOV
37 
38 
39 
40 # Specify path to nearline output files...
41 SearchPath="/lbne/data2/users/lbnedaq/nearline/v*/*/*/"
42 
43 
44 
45 # Setup the LArSoft/dunetpc environment to pick up root.
46 export RelDir=/home/lbnedaq/nearline/nearline_test_release_${REL}
47 export ScriptPath=${RelDir}/srcs/dunetpc/dune/NearlineMonitor/scripts
48 export LPDir=${RelDir}/localProducts_larsoft_${REL}_${COMP}_prof
49 
50 echo ""
51 echo "Setting up LArSoft/DUNETPC:"
52 source /grid/fermiapp/products/dune/setup_dune.sh
53 cd $LPDir
54 source ./setup
55 cd ..
56 mrbslp
57 cd ~/nearline/temp
58 echo ""
59 
60 
61 
62 # Make temporary list of files to be processed
63 rm -vf 35t_${DAYS}Day_Nearline_File_List.txt
64 find ${SearchPath} -mtime -${DAYS} -name "lbne_*_nearline*.root" | sort -r > 35t_${DAYS}Day_Nearline_File_List.txt
65 
66 
67 
68 # Execute root script to make plots...
69 root -l -b -q "${ScriptPath}/NearlinePlotMaker.C+(${DAYS})"
70 
71 
72 
73 # Done, remove the lock file...
74 rm -v /tmp/Batch-MakeNearlineWebPlots-${REL}-${DAYS}days.lock