ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitProd/Processing/bin/status.py
Revision: 1.2
Committed: Sat Jun 5 02:36:28 2010 UTC (14 years, 11 months ago) by paus
Content type: text/x-python
Branch: MAIN
CVS Tags: Mit_025c_branch2, Mit_025c_branch1, Mit_029_pre1, Mit_028a, Mit_025c_branch0, Mit_028, Mit_027a, Mit_027, Mit_026, Mit_025e, Mit_025d, Mit_025c, Mit_025b, Mit_025a, Mit_025, Mit_025pre2, Mit_024b, Mit_025pre1, Mit_024a, Mit_024, Mit_023, Mit_022a, Mit_022, Mit_020d, TMit_020d, Mit_020c, Mit_021, Mit_021pre2, Mit_021pre1, Mit_020b, Mit_020a, Mit_020, Mit_020pre1, Mit_018, Mit_017, Mit_017pre3, Mit_017pre2, Mit_017pre1, Mit_016, Mit_015b, Mit_015a, Mit_015, Mit_014e, Mit_014d, Mit_014c, Mit_014b, Mit_014a
Branch point for: Mit_025c_branch
Changes since 1.1: +55 -0 lines
Log Message:
Wow I forgot all about my cvs.

File Contents

# User Rev Content
1 paus 1.2 #!/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 = "/pnfs/cmsaf.mit.edu/t2bat/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 filefi/013/' + dataset + '.lfns '
55     os.system(cmd)