#!/bin/bash # Script to mirror Look Up Tables (LUTs) that are required in order # to run the CSPP SDRs software. # # It is meant to by called by another script executed via cron # whick checks to see if it is already running, in case one gets stuck # and they start to back up. This script should be run about once # per week. It uses 'lftp' to mirror the LUT ancillary data directory # from http://jpssdb.ssec.wisc.edu/ancillary/LUTS , and will only # grab any new files that have been updated or changed since the last # update. # # Written by Kathleen Strabala UW/SSEC July 2012 # # if [ -z "${CSPP_SDR_HOME}" ] ; then echo "Please set CSPP_SDR_HOME " exit 1 fi # See if local and remote ancillary directories have been set if [[ -z $CSPP_RT_SDR_LUTS ]]; then echo "The CSPP_RT_SDR_LUTS directory has not been set. Defaulting to $CSPP_SDR_HOME/anc/cache/luts" export CSPP_RT_SDR_LUTS=${CSPP_SDR_HOME}/anc/cache/luts fi if [[ -z $JPSS_REMOTE_ANC_DIR ]]; then export JPSS_REMOTE_ANC_DIR=http://jpssdb.ssec.wisc.edu/ancillary/LUTS_V_1_5/ fi # Use lftp to download only the files that are new or updated echo "" echo "Begin CSPP LUT update on " `date` echo "" FILE_TYPE="-I *.*.*" lftp -c "mirror --verbose --only-newer --parallel=4 $JPSS_REMOTE_ANC_DIR $FILE_TYPE $CSPP_RT_SDR_LUTS" if [ $? -ne 0 ] ; then echo "" echo "CSPP BLOB Look-up-table update was not successful." exit 1 fi FILE_TYPE="-I *.asc" lftp -c "mirror --verbose --only-newer --parallel=4 $JPSS_REMOTE_ANC_DIR $FILE_TYPE $CSPP_RT_SDR_LUTS" if [ $? -ne 0 ] ; then echo "" echo "CSPP ASCII Look-up-table update was not successful." exit 1 fi echo "CSPP Look-up-table update completed." exit 0