ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitProd/Processing/bin/status.py
(Generate patch)

Comparing UserCode/MitProd/Processing/bin/status.py (file contents):
Revision 1.1 by paus, Sat Jun 5 01:49:22 2010 UTC vs.
Revision 1.2 by paus, Sat Jun 5 02:36:28 2010 UTC

# Line 0 | Line 1
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 = "/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)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines