src/utils/qa/updateTimes.csh 1.25

1.25 2009/09/08 17:47:26 kuhn
fixed updateTimes.csh to work with msyql v5.0 dumps. also simplified the way it works, removing some of the flexibily seldom used. changed call in genbankRun.csh to use new version.
Index: src/utils/qa/updateTimes.csh
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/utils/qa/updateTimes.csh,v
retrieving revision 1.24
retrieving revision 1.25
diff -b -B -U 4 -r1.24 -r1.25
--- src/utils/qa/updateTimes.csh	21 Apr 2009 20:37:00 -0000	1.24
+++ src/utils/qa/updateTimes.csh	8 Sep 2009 17:47:26 -0000	1.25
@@ -11,32 +11,21 @@
 ################################
 
 set tablelist=""
 set db=""
-set mach1="hgwdev"
-set mach2="hgwbeta"
-set mach3=""
-set host1=""
-set host2=""
-set rr1="false"
-set rr2="false"
-set rr3="false"
 set first=""
 set second=""
 set third=""
-set allThree=""
 
-if ( $#argv < 2 || $#argv > 5 ) then
+if ( $#argv != 2 ) then
   echo
-  echo "  gets update times from any two or all three machines for tables in list." 
+  echo "  gets update times for three machines for tables in list." 
   echo "  warning:  not in real time for RR.  uses overnight dump." 
   echo
-  echo "    usage:  database tablelist [3 | all | machine1] [machine2] [machine3] "
-  echo "            (defaults to dev and beta)"
+  echo "    usage:  database tablelist "
   echo
+  echo "            reports on dev, beta and RR"
   echo "            tablelist will accept single table"
-  echo '            "3" indicates dev, beta and hgw1'
-  echo '            "all" indicates dev, beta, all 8 RR machines'
   echo
   exit
 else
   set db=$argv[1]
@@ -49,65 +38,10 @@
  exit 1
 endif
 
 
-if ($#argv == 3) then
-  set allThree=$argv[3]
-  if ($allThree == 3 || $allThree == "all") then
-    set rr1="false"
-    set rr2="false"
-    set rr3="true"
-    set mach3="hgw1"
-  else
-    set mach1=$argv[3]
-    set mach2=""
-    checkMachineName.csh $mach1
-    if ($status) then
-      exit 1
-    endif
-  endif
-endif
-
-if ( $#argv == 4  || $#argv == 5) then
-  set mach1=$argv[3]
-  set mach2=$argv[4]
-  if ( $#argv == 5) then
-    set mach3=$argv[5]
-  endif
-  checkMachineName.csh $mach1 $mach2 $mach3
-  if ( $status ) then
-    exit 1
-  endif
-endif
-
-if ( $mach1 == "hgwbeta" ) then
-  set host1="-h $sqlbeta"
-endif
-
-if ( $mach2 == "hgwbeta" ) then
-  set host2="-h $sqlbeta"
-endif
- 
-if ( $mach3 == "hgwbeta" ) then
-  set host3="-h $sqlbeta"
-endif
-
-# set flags for RR queries
-if ( $mach1 != "hgwdev" &&  $mach1 != "hgwbeta" ) then
-  set rr1="true"
-endif
-
-if ( $mach2 != "hgwdev" &&  $mach2 != "hgwbeta" ) then
-  set rr2="true"
-endif
-
-if ( $mach3 != "hgwdev" &&  $mach3 != "hgwbeta" ) then
-  set rr3="true"
-endif
-
-
 # check if it is a file or a tablename
-file $tablelist | egrep "ASCII text" > /dev/null
+file $tablelist | egrep -q "ASCII text"
 if (! $status) then
   set tables=`cat $tablelist`
 else
   set tables=$tablelist
@@ -117,45 +51,29 @@
   echo
   echo $table
   echo "============="
 
-  if ( $rr1 == "true" ) then
-    set first=`getRRtableStatus.csh $db $table update_time $mach1`
-  else
-    set first=`hgsql $host1 -N -e 'SHOW TABLE STATUS LIKE "'$table'"' $db \
-      | awk '{print $13, $14}'`
+  set first=`hgsql -N -e 'SHOW TABLE STATUS LIKE "'$table'"' $db \
+    | awk '{print $14, $15}'`
+  if ( $status ) then
+    echo "."
+    continue
   endif
 
-  if ( $rr2 == "true" ) then
-    set second=`getRRtableStatus.csh $db $table update_time $mach2`
-  else
-    set second=`hgsql $host2 -N -e 'SHOW TABLE STATUS LIKE "'$table'"' $db \
-      | awk '{print $13, $14}'`
+  set second=`hgsql -N -e 'SHOW TABLE STATUS LIKE "'$table'"' $db \
+    | awk '{print $14, $15}'`
+  if ( $status ) then
+    echo "."
+    continue
   endif
 
-  if ( $mach3 != "" ) then
-    if ( $rr3 == "true" ) then
-      set third=`getRRtableStatus.csh $db $table update_time $mach3`
-    else
-      set third=`hgsql $host3 -N -e 'SHOW TABLE STATUS LIKE "'$table'"' $db \
-        | awk '{print $13, $14}'`
-    endif
+  set third=`getRRtableStatus.csh $db $table Update_time`
+  if ( $status ) then
+    set third=""
   endif
 
   echo "."$first
-  if ( $mach2 != "" ) then
     echo "."$second
-  endif
-  if ($allThree == 3 || ($mach3 != "" && $allThree != "all")) then
-    echo "."$third
-  else
     echo
-  endif
-
-  if ($allThree == "all") then
-    foreach machine ( hgw1 hgw2 hgw3 hgw4 hgw5 hgw6 hgw7 hgw8 )
-      set third=`getRRtableStatus.csh $db $table update_time $machine`
       echo "."$third
-    end
-  endif
 end
 echo