1 |
dkralph |
1.1 |
#!/bin/bash
|
2 |
|
|
|
3 |
|
|
hostname
|
4 |
|
|
. /afs/cern.ch/cms/LCG/LCG-2/UI/cms_ui_env.sh
|
5 |
|
|
grid-proxy-info
|
6 |
anlevin |
1.5 |
rsync t3btch110.mit.edu:$X509_USER_PROXY $X509_USER_PROXY
|
7 |
dkralph |
1.1 |
ls -ltrh $X509_USER_PROXY
|
8 |
anlevin |
1.5 |
cd /home/anlevin/cms/cmssw/CMSSW_5_2_3_patch3/src/MitHzz4l
|
9 |
dkralph |
1.1 |
|
10 |
dkralph |
1.2 |
output=`echo $@ | sed 's/[ ][ ]*/\n/g' | grep -A1 '\-\-output' | grep -v "\-\-output"`
|
11 |
|
|
outdir=`dirname $output`
|
12 |
dkralph |
1.4 |
# replace output dir with current dir in the command
|
13 |
|
|
command=`echo $@ | sed "s@$outdir/@/tmp/@"`
|
14 |
dkralph |
1.2 |
echo "command: $command"
|
15 |
|
|
$command
|
16 |
dkralph |
1.1 |
|
17 |
dkralph |
1.4 |
# rsync the file to the actual output dir
|
18 |
|
|
echo "hostname: " `hostname`
|
19 |
|
|
if hostname | grep 'mit\.edu\|t3btch' &> /dev/null; then
|
20 |
anlevin |
1.5 |
outputHost=t3btch110.mit.edu:
|
21 |
dkralph |
1.3 |
else
|
22 |
|
|
outputHost=
|
23 |
|
|
fi
|
24 |
dkralph |
1.4 |
echo "rsync'ing: rsync -v /tmp/`basename $output | sed 's/.root/.\*/'` $outputHost$outdir"
|
25 |
dkralph |
1.3 |
rsync -v /tmp/`basename $output | sed 's/.root/.\*/'` $outputHost$outdir
|
26 |
dkralph |
1.2 |
|
27 |
|
|
ls -ltrh /tmp/`basename $output | sed 's/.root/.\*/'`
|
28 |
|
|
rm -v /tmp/`basename $output | sed 's/.root/.\*/'`
|