#! /bin/bash # # Download the beam summary data from repo.nd280.org/nd280beam using # wget. This is run without arguments. # The location of the input files. if [ ${BEAMFILES}x == x ]; then BEAMFILES=http://repo.nd280.org/nd280beam/ fi # This directory should ALWAYS exist, but check anyway. BEAMDATABSD=${ENV_BSD_BSD} BEAMDATASPD=${ENV_BSD_SPD} BEAMDATAVER=${ENV_BSD_VER} if [ ! -d ${OABEAMDATAROOT} ]; then echo comet-get-beam: oaBeamData directory is missing! echo where is: ${OABEAMDATAROOT} exit 1 fi cd ${OABEAMDATAROOT} # This directory won't exist when the package is checkout the first time. if [ ! -d ${OABEAMDATAROOT}/../${BEAMDATABSD} ]; then mkdir ../${BEAMDATABSD} fi if [ ! -d ${OABEAMDATAROOT}/${BEAMDATABSD} ]; then ln -s ${OABEAMDATAROOT}/../${BEAMDATABSD} ${OABEAMDATAROOT}/${BEAMDATABSD} fi if [ ! -d ${OABEAMDATAROOT}/${BEAMDATABSD}/${ENV_BSD_VER} ]; then mkdir ${BEAMDATABSD}/${ENV_BSD_VER} fi if [ ! -d ${OABEAMDATAROOT}/../${BEAMDATASPD} ]; then mkdir ${OABEAMDATAROOT}/../${BEAMDATASPD} fi if [ ! -d ${OABEAMDATAROOT}/${BEAMDATASPD} ]; then ln -s ${OABEAMDATAROOT}/../${BEAMDATASPD} ${OABEAMDATAROOT}/${BEAMDATASPD} fi cd ${OABEAMDATAROOT}/${BEAMDATABSD} # Get an index of beam files. wget -q -S -N --http-user=cometbeam --http-passwd=cometbeam ${BEAMFILES}/${BEAMDATABSD}/ -o /dev/null if [ ! -f index.html ]; then echo "comet-get-beam: Cannot check for new beam summary data. Error:Index Part" exit 1 fi # Build a list of the files download. cat index.html | \ egrep "bsd_${BEAMDATAVER}_[0-9]{8}_[[:xdigit:]]{32}" | \ sed 's/