94383c9c3192d68eee122deb4effb0313f13c773
kuhn
  Mon Dec 10 18:59:20 2012 -0800
added some logic to get the link name for each url and provision for backup in genecats when running script more than once in a day.  still needs some work.
diff --git src/utils/qa/checkAllStaticLinks.csh src/utils/qa/checkAllStaticLinks.csh
index 3893a3b..e11b75c 100755
--- src/utils/qa/checkAllStaticLinks.csh
+++ src/utils/qa/checkAllStaticLinks.csh
@@ -1,23 +1,22 @@
 #!/bin/tcsh
 source `which qaConfig.csh`
 
 ###############################################
-#  05-12-04  Robert Kuhn
+#  05-12-2004  Robert Kuhn
 # 
 #  checks all the static links in htdocs tree.
-#  needs a way to re-check bad links. 
 # 
 ###############################################
 
 set pathfile=""
 set excludeList=""
 set errdirs=0
 set errors=0
 set outfile=`date +%Y-%m-%d`
 
 if ( "$HOST" != "hgwdev" ) then
  echo "\n error: you must run this script on dev!\n"
  exit 1
 endif
 
 if ( $#argv != 1 ) then
@@ -40,54 +39,54 @@
   set pathfile=$argv[1]
   file $pathfile | grep -q "ASCII text"
   if ( $status ) then
     echo "\n file of paths $pathfile does not exist\n"
     exit 1
   endif
 endif
 
 set excludeList=/cluster/bin/scripts/linkCheckExclude
 if ( $status ) then
   echo "\n exclude file does not exist\n"
   exit 1
 endif
 
 foreach dir (`cat $pathfile`)
-  # echo "checking $dir"
+  echo "checking $dir"
   checkStaticLinks.csh $dir $excludeList
 end
 
 # consolidate results
 set dir=""
 rm -f $outfile
 # foreach dir ( 0 goldenPath.help test ) 
 foreach dir (`cat $pathfile`)
   set dir=`echo $dir | sed "s@/@.@g"`
   if ( $dir == 0 )  then
     set dir=htdocs
   endif
   tail -20 $dir.err | grep -q "errors in 0 files"
   if ( $status ) then
     cat $dir.err                                    >> $outfile
     echo "\n ===================================\n" >> $outfile
     @ errors = $errors + 1
   endif
   rm -f $dir.err
   @ errdirs = $errdirs + 1
 end
 echo " checked $errdirs directories"                >> $outfile
 echo " found $errors with errors"                   >> $outfile
 
 # allow two levels of backup
 set genecats = "/usr/local/apache/htdocs-genecats/qa/test-results/staticLinks"
 
 if ( -e $genecats/$outfile ) then
-  if ( -e $genecats/$outfile.bak ) then
+  if ( -e $genecats/${outfile}.bak ) then
     # echo "there's a bak file"
     # echo "making a bak2 file"
-    mv $genecats/$outfile.bak $genecats/${outfile}.bak2
+    mv $genecats/${outfile}.bak $genecats/${outfile}.bak2
   endif
     # echo "making a bak file"
     mv $genecats/$outfile $genecats/${outfile}.bak
 endif
-echo "moving file to genecats dir"
+# echo "moving file to genecats dir"
 mv $outfile /usr/local/apache/htdocs-genecats/qa/test-results/staticLinks