bc5c961b757f1fff2266780c4e24a5ceac3642ef chmalee Thu May 7 15:17:26 2020 -0700 Adding dbVar track hub common SVs as a native track, refs #25424 diff --git src/hg/utils/otto/dbVar/checkDbVar.sh src/hg/utils/otto/dbVar/checkDbVar.sh new file mode 100755 index 0000000..6a6f844 --- /dev/null +++ src/hg/utils/otto/dbVar/checkDbVar.sh @@ -0,0 +1,50 @@ +#!/bin/bash + +# Do not modify this script, modify the source tree copy: +# src/hg/utils/dbVar/checkDbVar.sh +# This script is used via a cron job and kept in $HOME/bin/scripts/ + +set -beEu -o pipefail +WORKDIR=$1 + +cleanUpOnError () { + echo "dbVar build failed" +} + +trap cleanUpOnError ERR +trap "cleanUpOnError; exit 1" SIGINT SIGTERM +umask 002 + +# cron jobs need to ensure this is true + +# this is where we are going to work +if [ ! -d "${WORKDIR}" ]; then + printf "ERROR in dbVar build, can not find the directory: %s\n" "${WORKDIR}" + exit 255 +fi + +# the release directory, where gbdb symlinks will point +if [ ! -d release ]; then + mkdir -p ${WORKDIR}/release/{hg19,hg38} +fi + +cd "${WORKDIR}" + +# see if anything is changing, if so, email notify, download, and build +wget https://ftp.ncbi.nlm.nih.gov/pub/dbVar/sandbox/dbvarhub/hub.txt -O tempUpdate +if [[ ! -e lastUpdate || tempUpdate -nt lastUpdate ]]; then + printf "New dbVar track hub:\nhttps://ftp.ncbi.nlm.nih.gov/pub/dbVar/sandbox/dbvarhub/\n" + today=`date +%F` + mkdir -p $today + cd $today + hubClone -download https://ftp.ncbi.nlm.nih.gov/pub/dbVar/sandbox/dbvarhub/hub.txt + cp dbVar/hg19/common*.bb ../release/hg19/ + cp dbVar/hg38/common*.bb ../release/hg38/ + cd .. + mv tempUpdate lastUpdate + echo "dbVar update done: `date`" +else + rm tempUpdate + echo "No update" +fi +