src/hg/utils/refreshNamedSessionCustomTracks/refreshSessionCtFiles.csh 1.2

1.2 2009/09/25 02:22:00 angie
Move aside tmp output after failure; keep a lastLog file with most recent successful log.
Index: src/hg/utils/refreshNamedSessionCustomTracks/refreshSessionCtFiles.csh
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/utils/refreshNamedSessionCustomTracks/refreshSessionCtFiles.csh,v
retrieving revision 1.1
retrieving revision 1.2
diff -b -B -U 1000000 -r1.1 -r1.2
--- src/hg/utils/refreshNamedSessionCustomTracks/refreshSessionCtFiles.csh	25 Sep 2009 00:34:31 -0000	1.1
+++ src/hg/utils/refreshNamedSessionCustomTracks/refreshSessionCtFiles.csh	25 Sep 2009 02:22:00 -0000	1.2
@@ -1,22 +1,29 @@
 #!/bin/csh -f
 
 # DO NOT EDIT the /cluster/bin/scripts copy of this file --
 # edit ~/kent/src/hg/utils/refreshNamedSessionCustomTracks/refreshSessionCtFiles.csh instead.
 
 # $Id$
 
 set logDir = /cluster/home/qateam/refrLog/hgcentral
 set hour = `date +%H`
 set tmpLog = $logDir/tmp.$hour.log
 set errLog = $logDir/err.$hour.log
+set tmpOut = /trash/ctDoNotRmNext.$hour.txt
+set errOut = $logDir/ctDoNotRmNext.$hour.err
 
 /cluster/bin/scripts/refreshSessionCtFilesInner.csh
 
 if ($status != 0) then
   echo refreshSessionCtFilesInner.csh failed\!
   tail $tmpLog
   mv $tmpLog $errLog
+  echo Logfile: $errLog
+  if (-e $tmpOut) then
+    mv $tmpOut $errOut
+    echo Intermediate out: $errOut
+  endif
   exit 1
 endif
 
-rm $tmpLog
+mv $tmpLog $logDir/lastLog