7 |
|
echo " ";echo " ==== JOB ENVIRONMENT ==== ";echo " "; whoami;id;/bin/hostname;pwd |
8 |
|
echo " ";echo " ==== START JOB WITH ARGUMENTS: $* ====";echo " " |
9 |
|
|
10 |
< |
klist |
10 |
> |
DCCP='/afs/cern.ch/project/gd/LCG-share/3.1.44-0/d-cache/dcap/bin/dccp' |
11 |
> |
LCGCP='lcg-cp' |
12 |
> |
SRMCP='srmcp' |
13 |
> |
|
14 |
> |
#klist |
15 |
|
id=`id -u` |
16 |
|
cp ~/.krb5/x509up_u${id} /tmp/ |
17 |
|
cp ~/.krb5/ticket /tmp/krb5cc_${id} |
18 |
|
ls -lhrt /tmp/krb5cc_${id} |
19 |
|
export KRB5CCNAME=FILE:/tmp/krb5cc_${id} |
20 |
< |
klist |
20 |
> |
#klist |
21 |
|
|
22 |
|
dataFile=$1 |
23 |
|
target=$2 |
29 |
|
pwd |
30 |
|
pwd=`pwd` |
31 |
|
|
32 |
< |
export SCRAM_ARCH='slc5_ia32_gcc434' |
33 |
< |
export VO_CMS_SW_DIR=/server/01a/mitdata/cmssoft |
34 |
< |
source $VO_CMS_SW_DIR/cmsset_default.sh |
35 |
< |
cd $HOME/cms/cmssw/019/CMSSW_3_9_7/src |
36 |
< |
eval `scram runtime -sh` |
37 |
< |
source $CMSSW_BASE/src/MitProd/Processing/bin/processing.sh |
38 |
< |
cd $pwd |
32 |
> |
# legacy but works on 32 bit machines |
33 |
> |
if [ "`uname -p`" != "x86_64" ] |
34 |
> |
then |
35 |
> |
source /afs/cern.ch/cms/LCG/LCG-2/UI/cms_ui_env_3_1.sh |
36 |
> |
fi |
37 |
> |
|
38 |
> |
#export SCRAM_ARCH='slc5_ia32_gcc434' |
39 |
> |
#export VO_CMS_SW_DIR=/server/01a/mitdata/cmssoft |
40 |
> |
#source $VO_CMS_SW_DIR/cmsset_default.sh |
41 |
> |
#cd $HOME/cms/cmssw/019/CMSSW_3_9_7/src |
42 |
> |
#eval `scram runtime -sh` |
43 |
> |
#source $CMSSW_BASE/src/MitProd/Processing/bin/processing.sh |
44 |
> |
#cd $pwd |
45 |
|
|
46 |
|
# make storage Urls for target and source |
47 |
|
|
51 |
|
storageEle="se01.cmsaf.mit.edu" |
52 |
|
storagePath='/srm/managerv2?SFN=' |
53 |
|
targetUrl="srm://${storageEle}:8443${storagePath}$target" |
54 |
+ |
elif [ "`echo $target | grep /mnt/hadoop/cms/store`" != "" ] |
55 |
+ |
then |
56 |
+ |
storageEle="se01.cmsaf.mit.edu" |
57 |
+ |
storagePath='/srm/v2/server?SFN=' |
58 |
+ |
targetUrl="srm://${storageEle}:8443${storagePath}$target" |
59 |
|
elif [ "`echo $target | grep /castor/cern.ch`" != "" ] |
60 |
|
then |
61 |
|
storageEle='srm-cms.cern.ch' |
62 |
|
storagePath='/srm/managerv2?SFN=' |
63 |
|
targetUrl="srm://${storageEle}:8443${storagePath}$target" |
64 |
|
else |
65 |
< |
targetUrl="" |
65 |
> |
targetUrl="file:///$target" |
66 |
> |
#targetUrl="" |
67 |
|
fi |
68 |
|
|
69 |
|
sourceUrl="file:///$dataFile" |
72 |
|
storageEle="se01.cmsaf.mit.edu" |
73 |
|
storagePath='/srm/managerv2?SFN=' |
74 |
|
sourceUrl="srm://${storageEle}:8443${storagePath}$dataFile" |
75 |
+ |
elif [ "`echo $dataFile | grep /mnt/hadoop/cms/store`" != "" ] |
76 |
+ |
then |
77 |
+ |
storageEle="se01.cmsaf.mit.edu" |
78 |
+ |
storagePath='/srm/v2/server?SFN=' |
79 |
+ |
sourceUrl="srm://${storageEle}:8443${storagePath}$dataFile" |
80 |
|
elif [ "`echo $dataFile | grep /castor/cern.ch`" != "" ] |
81 |
|
then |
82 |
|
storageEle='srm-cms.cern.ch' |
85 |
|
fi |
86 |
|
|
87 |
|
echo " "; echo "Starting download now"; echo " " |
88 |
< |
if [ "$targetUrl" != "" ] |
88 |
> |
if [ "`echo $dataFile | grep /pnfs/cmsaf.mit.edu`" == "" ] |
89 |
|
then |
90 |
< |
echo "srmcp -srm_protocol_version=2 $sourceUrl $targetUrl" |
91 |
< |
srmcp -srm_protocol_version=2 $sourceUrl $targetUrl |
90 |
> |
echo "$LCGCP -D srmv2 -b $sourceUrl $targetUrl" |
91 |
> |
$LCGCP -D srmv2 -b $sourceUrl $targetUrl |
92 |
> |
|
93 |
> |
#echo "$SRMCP -2 $sourceUrl $targetUrl" |
94 |
> |
#$SRMCP -2 $sourceUrl $targetUrl |
95 |
> |
|
96 |
|
else |
97 |
< |
echo "dccp dcap://t2srv0005.cmsaf.mit.edu/$dataFile $target" |
98 |
< |
dccp dcap://t2srv0005.cmsaf.mit.edu/$dataFile $target |
97 |
> |
echo "$DCCP dcap://t2srv0005.cmsaf.mit.edu/$dataFile $target" |
98 |
> |
$DCCP dcap://t2srv0005.cmsaf.mit.edu/$dataFile $target |
99 |
|
fi |
100 |
|
|
101 |
|
exit 0 |