Index: trunk/tools/eam/rawfix.20230221/src/advance.rawfix.sh
===================================================================
--- trunk/tools/eam/rawfix.20230221/src/advance.rawfix.sh	(revision 42429)
+++ trunk/tools/eam/rawfix.20230221/src/advance.rawfix.sh	(revision 42429)
@@ -0,0 +1,47 @@
+#!/bin/csh
+
+if ($#argv < 1) then
+  echo "USAGE: advance.rawfix.sh all"
+  echo "USAGE: advance.rawfix.sh night (YYYYMMDD)"
+  exit 2
+endif
+
+set mode = $1
+
+if ($mode == "all") then
+  set nights = `./check.rawfix.sh all | awk '(NR > 1){print $1}'`
+  foreach f ($nights)
+    echo -n "$f "
+    ./advance.rawfix.sh night $f 
+  end
+  exit 0
+endif
+
+if ($mode == "night") then
+  if ($#argv != 2) then
+    echo "USAGE: advance.rawfix.sh night (YYYYMMDD)"
+    exit 2
+  endif
+
+  set night = $2
+
+  set mystate = `./check.rawfix.sh night $2 | awk '(NR == 2){print $2}'`
+
+  set tgtstate = "NONE"
+  if ($mystate == "ckchip.done")     set tgtstate = "fixchip.new"
+  if ($mystate == "fixchip.done")    set tgtstate = "md5sum.new"    
+  if ($mystate == "md5sum.done")     set tgtstate = "md5chk.new"    
+  if ($mystate == "md5chk.done")     set tgtstate = "fixchip_s2.new"   
+  if ($mystate == "fixchip_s2.done") set tgtstate = "md5sum_s2.new"    
+  if ($mystate == "md5sum_s2.done")  set tgtstate = "md5chk_s2.new"    
+  if ($mystate == "md5chk_s2.done")  set tgtstate = "fixchip_s3.new"   
+
+  if ($tgtstate == "NONE") then
+    echo "nothing to advance"
+    exit 0
+  endif
+
+  ./update.rawfix.sh $night $tgtstate
+  exit 0
+endif
+
Index: trunk/tools/eam/rawfix.20230221/src/rawfix.advance.pt
===================================================================
--- trunk/tools/eam/rawfix.20230221/src/rawfix.advance.pt	(revision 42429)
+++ trunk/tools/eam/rawfix.20230221/src/rawfix.advance.pt	(revision 42429)
@@ -0,0 +1,37 @@
+
+## regularly run the command advance.rawfits.sh
+task nights.advance
+  periods -poll 10
+  periods -exec 10
+  periods -timeout 30
+
+  stdout $LOGDIR/advance.log  
+  stderr $LOGDIR/advance.log
+
+  # only run one of these tasks at a time
+  npending 1
+
+  task.exec
+    command advance.rawfix.sh all
+  end
+
+  # need to delete DONE entries here so the book is not repopulated
+  # by already-running load tasks
+  task.exit 0
+    echo "done with advance"    
+  end
+
+  # exit values other than 0:
+  task.exit    default
+    showcommand failure
+  end
+
+  task.exit    crash
+    showcommand crash
+  end
+
+  # operation times out?
+  task.exit    timeout
+    showcommand timeout
+  end
+end
