ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitProd/Processing/bin/status.py
Revision: 1.4
Committed: Sat Jun 29 03:05:18 2013 UTC (11 years, 10 months ago) by paus
Content type: text/x-python
Branch: MAIN
CVS Tags: Mit_032, Mit_031, HEAD
Changes since 1.3: +1 -1 lines
Log Message:
Improve lfn handling.

File Contents

# Content
1 #!/usr/bin/env python
2 #---------------------------------------------------------------------------------------------------
3 # Script to get a quick overview how far the production has come.
4 #
5 # Author: C.Paus (July 1, 2008)
6 #---------------------------------------------------------------------------------------------------
7 import os,sys,getopt,re,string
8 import task
9
10 #===================================================================================================
11 # Main starts here
12 #===================================================================================================
13 # Define string to explain usage of the script
14 usage = \
15 "\nUsage: status.py [ --dataset= --help ]\n"
16
17 # Define the valid options which can be specified and check out the command line
18 valid = ['dataset=','help']
19 try:
20 opts, args = getopt.getopt(sys.argv[1:], "", valid)
21 except getopt.GetoptError, ex:
22 print usage
23 print str(ex)
24 sys.exit(1)
25
26 # --------------------------------------------------------------------------------------------------
27 # Get all parameters for this little task
28 # --------------------------------------------------------------------------------------------------
29 # Set defaults
30 dataset = ''
31
32 # Read new values from the command line
33 for opt, arg in opts:
34 if opt == "--help":
35 print usage
36 sys.exit(0)
37 if opt == "--dataset":
38 dataset = arg
39
40 # Deal with obvious problems
41 if dataset == "":
42 cmd = "--dataset parameter not provided. This is a required parameter."
43 raise RuntimeError, cmd
44
45 # --------------------------------------------------------------------------------------------------
46 # Here is where the real action starts -------------------------------------------------------------
47 # --------------------------------------------------------------------------------------------------
48 dir = "/mnt/hadoop/cms/store/user/paus/filefi/013/"
49
50 cmd = 'list ' + dir + dataset + ' | grep root | wc '
51 os.system(cmd)
52 cmd = 'list ' + dir + dataset + '/crab_* | grep root | wc '
53 os.system(cmd)
54 cmd = 'wc lfns/' + dataset + '.lfns '
55 os.system(cmd)