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

Comparing UserCode/MitProd/Processing/bin/downloadFile.sh (file contents):
Revision 1.2 by ceballos, Fri Dec 10 09:41:33 2010 UTC vs.
Revision 1.7 by paus, Wed Oct 19 10:43:11 2011 UTC

# Line 7 | Line 7
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  
# Line 26 | Line 28 | echo " "; echo "Initialize CMSSW"; echo
28   pwd
29   pwd=`pwd`
30  
31 < export SCRAM_ARCH=slc5_ia32_gcc434
32 < export VO_CMS_SW_DIR=~cmsprod/cmssoft
33 < source $VO_CMS_SW_DIR/cmsset_default.sh
34 < #cd     $HOME/cms/cmssw/016/CMSSW_3_8_6_patch1/src
35 < cd     $HOME/cms/cmssw/016/CMSSW_3_8_6/src
36 < eval   `scram runtime -sh`
37 < source $CMSSW_BASE/src/MitProd/Processing/bin/processing.sh
36 < cd $pwd
37 < #list $dataDir
31 > #export SCRAM_ARCH='slc5_ia32_gcc434'
32 > #export VO_CMS_SW_DIR=/server/01a/mitdata/cmssoft
33 > #source $VO_CMS_SW_DIR/cmsset_default.sh
34 > #cd     $HOME/cms/cmssw/019/CMSSW_3_9_7/src
35 > #eval   `scram runtime -sh`
36 > #source $CMSSW_BASE/src/MitProd/Processing/bin/processing.sh
37 > #cd $pwd
38  
39 < # Get ready to run
40 < rm -f $logFile
39 > # make storage Urls for target and source
40  
41 < echo " "; echo "Starting download now"; echo " "
42 < if   [ "`echo $dataFile | grep /castor/cern.ch`" != "" ]
41 > targetUrl="file:///$target"
42 > if   [ "`echo $target | grep /pnfs/cmsaf.mit.edu`" != "" ]
43 > then
44 >  storageEle="se01.cmsaf.mit.edu"
45 >  storagePath='/srm/managerv2?SFN='
46 >  targetUrl="srm://${storageEle}:8443${storagePath}$target"
47 > elif [ "`echo $target | grep /mnt/hadoop/cms/store`" != "" ]
48 > then
49 >  storageEle="se01.cmsaf.mit.edu"
50 >  storagePath='/srm/v2/server?SFN='
51 >  targetUrl="srm://${storageEle}:8443${storagePath}$target"
52 > elif [ "`echo $target | grep /castor/cern.ch`" != "" ]
53   then
54    storageEle='srm-cms.cern.ch'
55    storagePath='/srm/managerv2?SFN='
56 <  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
56 >  targetUrl="srm://${storageEle}:8443${storagePath}$target"
57   else
58 <  echo ' Copy mechanism not known.'
62 <  exit 1
58 >  targetUrl=""
59   fi
60  
61 + sourceUrl="file:///$dataFile"
62 + if   [ "`echo $dataFile | grep /pnfs/cmsaf.mit.edu`" != "" ]
63 + then
64 +  storageEle="se01.cmsaf.mit.edu"
65 +  storagePath='/srm/managerv2?SFN='
66 +  sourceUrl="srm://${storageEle}:8443${storagePath}$dataFile"
67 + elif [ "`echo $dataFile | grep /mnt/hadoop/cms/store`" != "" ]
68 + then
69 +  storageEle="se01.cmsaf.mit.edu"
70 +  storagePath='/srm/v2/server?SFN='
71 +  sourceUrl="srm://${storageEle}:8443${storagePath}$dataFile"
72 + elif [ "`echo $dataFile | grep /castor/cern.ch`" != "" ]
73 + then
74 +  storageEle='srm-cms.cern.ch'
75 +  storagePath='/srm/managerv2?SFN='
76 +  sourceUrl="srm://${storageEle}:8443${storagePath}$dataFile"
77 + fi
78  
79 < rm -f $logFile
79 > echo " "; echo "Starting download now"; echo " "
80 > if   [ "$targetUrl" != "" ]
81 > then
82 >  echo "$LCGCP -D srmv2 -b $sourceUrl $targetUrl"
83 >  $LCGCP -D srmv2 -b  $sourceUrl $targetUrl
84 > else
85 >  echo "$DCCP dcap://t2srv0005.cmsaf.mit.edu/$dataFile $target"
86 >  $DCCP dcap://t2srv0005.cmsaf.mit.edu/$dataFile $target
87 > fi
88  
89   exit 0

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines