50b94a07ac1c74bc32ca230dd9c66ee36ad20d94
chmalee
  Mon Mar 1 15:54:10 2021 -0800
GBiB: Move cgi-bin and htdocs symlinks out so that old and new gbibs receive the symlinks instead of just old gbibs, refs #26943

diff --git src/browserbox/root/updateBrowser.sh src/browserbox/root/updateBrowser.sh
index 6478ddf..aaea5e8 100755
--- src/browserbox/root/updateBrowser.sh
+++ src/browserbox/root/updateBrowser.sh
@@ -243,30 +243,39 @@
    apt-get --no-install-recommends install -y python-mysqldb
    apt-get -y autoremove
 fi
 
 # install curl for checking if we are closer to European or US mirror
 if apt-cache policy curl | grep "Installed: .none." > /dev/null; then
    echo - Installing curl
    apt-get update
    apt-get --no-install-recommends install -y curl
    apt-get -y autoremove
    # make sure that the mysql server is re-configured now
    rm -f /usr/local/apache/trash/registration.txt
 fi
 
 echo
+
+# Feb 2021: cgi-bin and htdocs are now too big for the root partition. Moving both to the data partition:
+if [ ! -L /usr/local/apache/htdocs ] ; then
+ rsync -avp /usr/local/apache/htdocs/ /data/htdocs/ && rm -rf /usr/local/apache/htdocs && ln -s /data/htdocs /usr/local/apache/htdocs 
+fi
+if [ ! -L /usr/local/apache/cgi-bin ] ; then
+ rsync -avp /usr/local/apache/cgi-bin/ /data/cgi-bin/ && rm -rf /usr/local/apache/cgi-bin && ln -s  /data/cgi-bin /usr/local/apache/cgi-bin
+fi
+
 echo - Updating the genome browser software via rsync:
 
 # CGI-BIN and HTDOCS:
 # the parameter "hgwdev" copies over only the beta/alpha CGIs from hgwdev
 if [ "$1" == "hgwdev" ] ; then
     # note the missing -u option to RSYNC: in hgwdev mode, we want to overwrite everything.
     # On a development machine, the developer might have touched a file
     # for testing. We want to make sure that all local files are overwritten by the 
     # files on hgwdev
     RSYNCOPTS="-ltrvh"
     user=$2
     dirExt=$3
 
     if [ "$user" == "" ]; then
         echo arguments: updateBrowser hgwdev hgwdevUsername cgiDirectoryExtension 
@@ -293,37 +302,30 @@
       RSYNCAPACHE="$RSYNCAPACHE --exclude ENCODE/**.pdf --exclude *.gz --exclude *.bw --exclude *.bb --exclude *.bam --exclude goldenPath/**.pdf --exclude admin/** --exclude goldenPath/customTracks/** --exclude pubs/** --exclude ancestors/** --exclude training/** --exclude trash --exclude style-public/** --exclude js-public/** --exclude **/edw* --exclude images/mammalPsg/** --exclude **/encodeTestHub* --exclude favicon.ico --exclude folders --exclude ENCODE/** --exclude ENCODE/** --exclude Neandertal/** --exclude gbib/** --exclude generator/** --exclude js-*/** --exclude js/*/* --exclude .\* --exclude x86_64/* --exclude .xauth --exclude .hg.conf --exclude hgHeatmap* --exclude hg.conf --exclude 'hgt/**' --exclude admin/** --exclude images --exclude trash --exclude edw* --exclude visiGeneData/** --exclude crom_dir/ --exclude testp/ --exclude *.exe --exclude *.old --exclude *.tmp --exclude *.bak --exclude test* --exclude hg.conf* --exclude **/hgHeatmap* --exclude ~* --exclude Intronerator** --exclude hgText --exclude hgSubj --exclude gisaid* --exclude nt4.dir --exclude qaPush* --exclude docIdView --exclude ct/ --exclude *.bak --exclude hg.conf* --exclude gsid*/ --exclude *.private --exclude useCount --exclude ~* --exclude lssnp/ --exclude hg.conf.local"
     fi
   
     # remove things that are on hgwdev beta directories but not necessary on the gbib
     if [ "$dirExt" == "beta" ] ; then
       RSYNCAPACHE="$RSYNCAPACHE --exclude favicon*.ico --exclude hg.conf* --exclude ENCODE --exclude *.gz --exclude *.bw --exclude *.bb --exclude *.bam --exclude goldenPath/**.pdf --exclude admin --exclude goldenPath/customTracks --exclude pubs --exclude ancestors --exclude training --exclude trash --exclude .htaccess --exclude htdocs --exclude Neandertal --exclude RNA-img --exclude ebola --exclude encodeDCC --exclude evoFold --exclude geneExtra --exclude js-public --exclude style-public --exclude hgNearData --exclude visiGeneData --exclude visiGene"
     fi
 
     rsync $RSYNCAPACHE $user@hgwdev.soe.ucsc.edu:/usr/local/apache/htdocs${htmlExt}/ /usr/local/apache/htdocs/
     rsync $RSYNCAPACHE $user@hgwdev.soe.ucsc.edu:/usr/local/apache/cgi-bin${cgiExt}/ /usr/local/apache/cgi-bin/
 
     PUSHLOC=$user@hgwdev.soe.ucsc.edu:/usr/local/apache/htdocs/gbib/push/
 
 # normal public updates from hgdownload are easier, not many excludes necessary
 else
-   # Feb 2021: cgi-bin and htdocs are now too big for the root partition. Moving both to the data partition.
-   if [ ! -L /usr/local/apache/htdocs ] ; then
-     rsync -avp /usr/local/apache/htdocs/ /data/htdocs/ && rm -rf /usr/local/apache/htdocs && ln -s /data/htdocs /usr/local/apache/htdocs 
-   fi
-   if [ ! -L /usr/local/apache/cgi-bin ] ; then
-     rsync -avp /usr/local/apache/cgi-bin/ /data/cgi-bin/ && rm -rf /usr/local/apache/cgi-bin && ln -s  /data/cgi-bin /usr/local/apache/cgi-bin
-   fi
 
     # update CGIs
     echo - Updating CGIs...
     rsync --delete -u $RSYNCOPTS $RSYNCSRC/$RSYNCCGIBIN /data/cgi-bin/ --exclude=hg.conf --exclude=hg.conf.local --exclude edw* --exclude *private --exclude hgNearData --exclude visiGeneData --exclude Neandertal 
 
     echo - Updating HTML files...
     # not using -u because we had a case with a 0-byte html page that was 
     # not updated anymore in #18337
     rsync --delete $RSYNCOPTS $RSYNCSRC/$RSYNCHTDOCS/ /data/htdocs/ --include **/customTracks/*.html --exclude ENCODE/ --exclude *.bam --exclude *.bb --exclude */*.bw --exclude */*.gz --exclude favicon.ico --exclude folders --exclude ancestors --exclude admin --exclude goldenPath/customTracks --exclude images/mammalPsg --exclude style/gbib.css --exclude images/title.jpg --exclude images/homeIconSprite.png --exclude goldenPath/**.pdf --exclude training
 
     PUSHLOC=hgdownload.soe.ucsc.edu::gbib/push/
 fi
 
 chown -R www-data.www-data /usr/local/apache/cgi-bin/*
 chown -R www-data.www-data /usr/local/apache/htdocs/