7 |
|
echo " ";echo " ==== JOB ENVIRONMENT ==== ";echo " "; whoami;id;/bin/hostname;pwd |
8 |
|
echo " ";echo " ==== START JOB WITH ARGUMENTS: $* ====";echo " " |
9 |
|
|
10 |
+ |
DCCP='/afs/cern.ch/project/gd/LCG-share/3.1.44-0/d-cache/dcap/bin/dccp' |
11 |
+ |
LCGCP='lcg-cp' |
12 |
+ |
|
13 |
|
klist |
14 |
< |
cp $HOME/.krb5/x509up_u5410 /tmp/ |
15 |
< |
cp $HOME/.krb5/ticket /tmp/krb5cc_5410 |
16 |
< |
ls -lhrt /tmp/krb5cc_5410 |
17 |
< |
export KRB5CCNAME=FILE:/tmp/krb5cc_5410 |
14 |
> |
id=`id -u` |
15 |
> |
cp ~/.krb5/x509up_u${id} /tmp/ |
16 |
> |
cp ~/.krb5/ticket /tmp/krb5cc_${id} |
17 |
> |
ls -lhrt /tmp/krb5cc_${id} |
18 |
> |
export KRB5CCNAME=FILE:/tmp/krb5cc_${id} |
19 |
|
klist |
20 |
|
|
21 |
|
dataFile=$1 |
22 |
|
target=$2 |
23 |
|
procId=$$ |
20 |
– |
logFile=`echo $dataDir/$dataFile | tr '/' '+'` |
21 |
– |
logFile=/tmp/$logFile |
24 |
|
|
25 |
|
echo " DataFile: $dataFile to: $target" |
26 |
|
|
28 |
|
pwd |
29 |
|
pwd=`pwd` |
30 |
|
|
31 |
< |
export SCRAM_ARCH=slc5_ia32_gcc434 |
32 |
< |
export VO_CMS_SW_DIR=~cmsprod/cmssoft |
31 |
< |
source $VO_CMS_SW_DIR/cmsset_default.sh |
32 |
< |
#cd $HOME/cms/cmssw/016/CMSSW_3_8_6_patch1/src |
33 |
< |
cd $HOME/cms/cmssw/016/CMSSW_3_8_6/src |
34 |
< |
eval `scram runtime -sh` |
35 |
< |
source $CMSSW_BASE/src/MitProd/Processing/bin/processing.sh |
36 |
< |
cd $pwd |
37 |
< |
#list $dataDir |
31 |
> |
# legacy but works on 32 bit machines |
32 |
> |
source /afs/cern.ch/cms/LCG/LCG-2/UI/cms_ui_env_3_1.sh |
33 |
|
|
34 |
< |
# Get ready to run |
35 |
< |
rm -f $logFile |
34 |
> |
#export SCRAM_ARCH='slc5_ia32_gcc434' |
35 |
> |
#export VO_CMS_SW_DIR=/server/01a/mitdata/cmssoft |
36 |
> |
#source $VO_CMS_SW_DIR/cmsset_default.sh |
37 |
> |
#cd $HOME/cms/cmssw/019/CMSSW_3_9_7/src |
38 |
> |
#eval `scram runtime -sh` |
39 |
> |
#source $CMSSW_BASE/src/MitProd/Processing/bin/processing.sh |
40 |
> |
#cd $pwd |
41 |
|
|
42 |
< |
echo " "; echo "Starting download now"; echo " " |
43 |
< |
if [ "`echo $dataFile | grep /castor/cern.ch`" != "" ] |
42 |
> |
# make storage Urls for target and source |
43 |
> |
|
44 |
> |
targetUrl="file:///$target" |
45 |
> |
if [ "`echo $target | grep /pnfs/cmsaf.mit.edu`" != "" ] |
46 |
> |
then |
47 |
> |
storageEle="se01.cmsaf.mit.edu" |
48 |
> |
storagePath='/srm/managerv2?SFN=' |
49 |
> |
targetUrl="srm://${storageEle}:8443${storagePath}$target" |
50 |
> |
elif [ "`echo $target | grep /mnt/hadoop/cms/store`" != "" ] |
51 |
> |
then |
52 |
> |
storageEle="se01.cmsaf.mit.edu" |
53 |
> |
storagePath='/srm/v2/server?SFN=' |
54 |
> |
targetUrl="srm://${storageEle}:8443${storagePath}$target" |
55 |
> |
elif [ "`echo $target | grep /castor/cern.ch`" != "" ] |
56 |
|
then |
57 |
|
storageEle='srm-cms.cern.ch' |
58 |
|
storagePath='/srm/managerv2?SFN=' |
59 |
< |
storageUrl="srm://${storageEle}:8443${storagePath}$dataFile" |
48 |
< |
echo " "; echo " Staging all file into castor ...."; echo " " |
49 |
< |
echo "lcg-cp $storageUrl $target" |
50 |
< |
#lcg-cp $storageUrl $target |
51 |
< |
rfcp $dataFile $target |
52 |
< |
elif [ "`echo $dataFile | grep /pnfs/cmsaf.mit.edu`" != "" ] |
53 |
< |
then |
54 |
< |
#storageEle="se01.cmsaf.mit.edu" |
55 |
< |
storageEle="t2srv0012.cmsaf.mit.edu" |
56 |
< |
storagePath='' |
57 |
< |
storageUrl="dcap://${storageEle}/$dataFile" |
58 |
< |
echo "dccp $storageUrl $target" |
59 |
< |
dccp $storageUrl $target |
59 |
> |
targetUrl="srm://${storageEle}:8443${storagePath}$target" |
60 |
|
else |
61 |
< |
echo ' Copy mechanism not known.' |
62 |
< |
exit 1 |
61 |
> |
targetUrl="" |
62 |
|
fi |
63 |
|
|
64 |
+ |
sourceUrl="file:///$dataFile" |
65 |
+ |
if [ "`echo $dataFile | grep /pnfs/cmsaf.mit.edu`" != "" ] |
66 |
+ |
then |
67 |
+ |
storageEle="se01.cmsaf.mit.edu" |
68 |
+ |
storagePath='/srm/managerv2?SFN=' |
69 |
+ |
sourceUrl="srm://${storageEle}:8443${storagePath}$dataFile" |
70 |
+ |
elif [ "`echo $dataFile | grep /mnt/hadoop/cms/store`" != "" ] |
71 |
+ |
then |
72 |
+ |
storageEle="se01.cmsaf.mit.edu" |
73 |
+ |
storagePath='/srm/v2/server?SFN=' |
74 |
+ |
sourceUrl="srm://${storageEle}:8443${storagePath}$dataFile" |
75 |
+ |
elif [ "`echo $dataFile | grep /castor/cern.ch`" != "" ] |
76 |
+ |
then |
77 |
+ |
storageEle='srm-cms.cern.ch' |
78 |
+ |
storagePath='/srm/managerv2?SFN=' |
79 |
+ |
sourceUrl="srm://${storageEle}:8443${storagePath}$dataFile" |
80 |
+ |
fi |
81 |
|
|
82 |
< |
rm -f $logFile |
82 |
> |
echo " "; echo "Starting download now"; echo " " |
83 |
> |
if [ "$targetUrl" != "" ] |
84 |
> |
then |
85 |
> |
echo "$LCGCP -D srmv2 -b $sourceUrl $targetUrl" |
86 |
> |
$LCGCP -D srmv2 -b $sourceUrl $targetUrl |
87 |
> |
else |
88 |
> |
echo "$DCCP dcap://t2srv0005.cmsaf.mit.edu/$dataFile $target" |
89 |
> |
$DCCP dcap://t2srv0005.cmsaf.mit.edu/$dataFile $target |
90 |
> |
fi |
91 |
|
|
92 |
|
exit 0 |