4c31f852319ea0972f600913d61fa0a480a366bf
hiram
  Mon Mar 4 16:33:21 2024 -0800
update md5sum.txt file in bigZips/genes refs #33088

diff --git src/hg/utils/automation/doNcbiRefSeq.pl src/hg/utils/automation/doNcbiRefSeq.pl
index de3f245..782a31e 100755
--- src/hg/utils/automation/doNcbiRefSeq.pl
+++ src/hg/utils/automation/doNcbiRefSeq.pl
@@ -908,35 +908,47 @@
     bedToBigBed -type=bed9+ -tab -as=\${HOME}/kent/src/hg/lib/txAliDiff.as \\
       ncbiRefSeqGenomicDiff.bed process/\$db.chrom.sizes ncbiRefSeqGenomicDiff.bb
     ln -s `pwd`/ncbiRefSeqGenomicDiff.bb $gbdbDir/ncbiRefSeqGenomicDiff.bb
   else
     rm -f ncbiRefSeqGenomicDiff.bed
   fi
 fi
 
 if [ -d "/usr/local/apache/htdocs-hgdownload/goldenPath/archive" ]; then
  mkdir -p /usr/local/apache/htdocs-hgdownload/goldenPath/archive/\$db/ncbiRefSeq/\$verString
  rm -f /usr/local/apache/htdocs-hgdownload/goldenPath/archive/\$db/ncbiRefSeq/\$verString/\$db.\$verString.ncbiRefSeq.gtf.gz
  ln -s `pwd`/\$db.*.ncbiRefSeq.gtf.gz \\
    /usr/local/apache/htdocs-hgdownload/goldenPath/archive/\$db/ncbiRefSeq/\$verString/\$db.\$verString.ncbiRefSeq.gtf.gz
 fi
 
-rm -f /usr/local/apache/htdocs-hgdownload/goldenPath/\$db/bigZips/genes/\$db.ncbiRefSeq.gtf.gz
-mkdir -p /usr/local/apache/htdocs-hgdownload/goldenPath/\$db/bigZips/genes
-ln -s `pwd`/\$db.*.ncbiRefSeq.gtf.gz \\
-    /usr/local/apache/htdocs-hgdownload/goldenPath/\$db/bigZips/genes/\$db.ncbiRefSeq.gtf.gz
-
+export DS=`date "+%%F"`
+export gpDir="/usr/local/apache/htdocs-hgdownload/goldenPath/\$db/bigZips/genes"
+rm -f \$gpDir/\$db.ncbiRefSeq.gtf.gz
+mkdir -p \$gpDir
+ln -s `pwd`/\$db.*.ncbiRefSeq.gtf.gz \$gpDir/\$db.ncbiRefSeq.gtf.gz
+export md5Sum="\$gpDir/md5sum.txt"
+export here=`pwd`
+if [ -s "\$md5Sum" ]; then
+  origSum=`realpath \$md5Sum`
+  bakFile="\${origSum}.\$DS"
+  if [! -s "\$bakFIle" ]; then
+    mv \$origSum \$bakFile
+    cd \$gpDir
+    md5sum *gz > \$origSum
+  fi
+fi
+cd \$here
 featureBits \$db ncbiRefSeq > fb.ncbiRefSeq.\$db.txt 2>&1
 cat fb.ncbiRefSeq.\$db.txt 2>&1
 _EOF_
     );
   }	#	if ($dbExists)
   $bossScript->execute();
 } # doLoad
 
 #########################################################################
 # * step: cleanup [fileServer]
 sub doCleanup {
   my $runDir = "$buildDir";
   my $whatItDoes = "It cleans up or compresses intermediate files.";
   my $bossScript = new HgRemoteScript("$runDir/doCleanup.csh", $fileServer,
 				      $runDir, $whatItDoes);