5 |
|
# Author: C.Paus (May 06, 2010) |
6 |
|
#--------------------------------------------------------------------------------------------------- |
7 |
|
import os,sys,getopt,re,srm |
8 |
+ |
t2user = os.environ['TIER2_USER'] |
9 |
|
|
10 |
|
def debugPrint(text): |
11 |
|
if debug: |
30 |
|
if re.search('/castor/cern.ch/',target): |
31 |
|
debugPrint(' Identified a castor directory: ' + target) |
32 |
|
cmd = 'rfdir ' + target |
32 |
– |
elif re.search('/pnfs/cmsaf.mit.edu/',target): |
33 |
– |
debugPrint(' Identified a tier-2 directory: ' + target) |
34 |
– |
cmd = 'ssh -x paus@cgate.mit.edu ls -1 ' + target + ' \>\& /dev/null' |
33 |
|
elif re.search('/mnt/hadoop/cms/store',target): |
34 |
|
debugPrint(' Identified a tier-2 hadoop directory: ' + target) |
35 |
|
target = srm.convertToUrl(target,debug) |
47 |
|
if re.search('/castor/cern.ch/',source): |
48 |
|
debugPrint(' Identified castor file') |
49 |
|
cmd = "stager_rm -M " + source + "; nsrm " + source |
52 |
– |
elif re.search('/pnfs/cmsaf.mit.edu/',source): |
53 |
– |
debugPrint(' Identified tier-2 file') |
54 |
– |
cmd = 'ssh -x paus@cgate.mit.edu rm -rf ' + source |
50 |
|
elif re.search('/mnt/hadoop/cms/store/user/paus',source): |
51 |
|
debugPrint(' Identified a tier-2 hadoop directory: ' + source) |
52 |
|
source = srm.convertToUrl(source,debug) |
72 |
|
catalogDir = '/home/cmsprod/catalog/local' |
73 |
|
if re.search('/castor/cern.ch/',source): |
74 |
|
catalogDir = '/home/cmsprod/catalog/cern' |
75 |
< |
elif re.search('/pnfs/cmsaf.mit.edu/',source) or \ |
81 |
< |
re.search('/mnt/hadoop/cms/store/user/paus',source): |
75 |
> |
elif re.search('/mnt/hadoop/cms/store/user/paus',source): |
76 |
|
catalogDir = '/home/cmsprod/catalog/t2mit' |
77 |
|
# now get the dataset and the book |
78 |
|
f = source.split('/') |