src/hg/utils/refreshNamedSessionCustomTracks/refreshSessionCtFilesInner.csh 1.3

1.3 2009/10/19 23:10:18 angie
Fixed syntax error in case of multiple previous logfiles.
Index: src/hg/utils/refreshNamedSessionCustomTracks/refreshSessionCtFilesInner.csh
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/utils/refreshNamedSessionCustomTracks/refreshSessionCtFilesInner.csh,v
retrieving revision 1.2
retrieving revision 1.3
diff -b -B -U 1000000 -r1.2 -r1.3
--- src/hg/utils/refreshNamedSessionCustomTracks/refreshSessionCtFilesInner.csh	25 Sep 2009 17:48:07 -0000	1.2
+++ src/hg/utils/refreshNamedSessionCustomTracks/refreshSessionCtFilesInner.csh	19 Oct 2009 23:10:18 -0000	1.3
@@ -1,61 +1,61 @@
 #!/bin/csh -ef
 
 # DO NOT EDIT the /cluster/bin/scripts copy of this file --
 # edit ~/kent/src/hg/utils/refreshNamedSessionCustomTracks/refreshSessionCtFilesInner.csh instead.
 
 # $Id$
 
 setenv HGDB_CONF /cluster/home/qateam/.hg.conf.hgcentral
 
 set today = `date +%y-%m-%d`
 set hour = `date +%H`
 set thisHour = $today.$hour
 set logDir = /cluster/home/qateam/refrLog/hgcentral
 set tmpLog = $logDir/tmp.$hour.log
 set tmpOut = /trash/ctDoNotRmNext.$hour.txt
 set finalOut = /trash/ctDoNotRm.txt
 
 mkdir -p $logDir/$today
 
 if (-e $tmpLog || -e $tmpOut) then
   echo "ERROR: $tmpLog and/or $tmpOut already exists!  Is another instance running?"
   echo "       Or does the file simply need to be cleaned up since yesterday?  Aborting."
   uptime
   exit 1
 endif
 
 set strayLogs = `find $logDir -maxdepth 1 -name tmp\*.log`
-if ($strayLogs != "") then
+if ("$strayLogs" != "") then
   echo "WARNING: stray log files (is a previous instance still running?)"
   echo $strayLogs
   uptime
 endif
 
 set strayOut = `find $tmpOut:h -maxdepth 1 -name ctDoNoRmNext\*`
-if ($strayOut != "") then
+if ("$strayOut" != "") then
   echo "WARNING: stray temporary output files (is a previous instance still running?)"
   echo $strayOut
   uptime
 endif
 
 ps -eafl > $logDir/before.log
 /cluster/bin/x86_64/refreshNamedSessionCustomTracks hgcentral -verbose=4 \
 >& $tmpLog
 ps -eafl > $logDir/after.log
 /cluster/bin/scripts/makeExclusionList.pl $tmpOut $tmpLog \
 | fgrep -w expired \
   > $logDir/$today/expired.$thisHour
 
 sleep 1
 
 if (-s $tmpOut) then
   mv $tmpOut $finalOut
 else
   echo $tmpOut does not exist or is empty -- not replacing $finalOut .
   exit 1
 endif
 
 sort -u $finalOut | sed -e 's@^/export@@' \
 | xargs -n 1024 ls -lu > $logDir/$today/$thisHour
 
 # Don't clean up $tmpLog here -- caller may use it.