MCProduction » download_all_http.sh
1 |
#To get an index.html:
|
---|---|
2 |
|
3 |
if [ $# -eq 0 ]; |
4 |
then
|
5 |
echo "No MCSerialNumber supplied" |
6 |
echo "./download_all_http.sh 35" |
7 |
exit
|
8 |
fi
|
9 |
|
10 |
PADDED_mcserial=`printf "%06d" $1` |
11 |
|
12 |
|
13 |
let "unpadded_century=$1/100*100" |
14 |
century=`printf "%06d" $unpadded_century` |
15 |
|
16 |
let "unpadded_10k=$unpadded_century/10000*10000" |
17 |
PADDED_10k=`printf "%06d" $unpadded_10k` |
18 |
|
19 |
# file path is:
|
20 |
|
21 |
|
22 |
rm index.html get_files.tmp
|
23 |
|
24 |
wget http://gfe02.grid.hep.ph.ic.ac.uk:8301/Simulation/MCproduction/$PADDED_10k/$century/$PADDED_mcserial/ |
25 |
cat index.html | grep href | grep Down | sed s/"\""/" "/g | awk '{print "wget http://gfe02.grid.hep.ph.ic.ac.uk:8301"$3}' | sed s/"..\/..\/..\/..\/.."//g > get_files.tmp |
26 |
chmod a+x get_files.tmp
|
27 |
./get_files.tmp |