Index: trunk/ippTasks/automate.pro
===================================================================
--- trunk/ippTasks/automate.pro	(revision 18607)
+++ trunk/ippTasks/automate.pro	(revision 18683)
@@ -37,4 +37,18 @@
   ipptool2book tmp automate -key name -uniq -setword pantaskState INIT.BLOCK
   queuedelete tmp
+
+  ## Pull out the ones that are to be run regularly
+  local npages
+  book npages automate -var npages
+  for i 0 $npages
+    book getpage automate $i -var pageName
+    if ("$pageName" != "NULL") 
+      book getword automate $pageName regular -var regularCommand
+      if ("$regularCommand" != "NULL")
+         book setword automate $pageName pantaskState INIT.REGULAR
+      end
+    end
+  end
+
 end
 
@@ -49,4 +63,7 @@
     active true
   end
+  task automate.regular
+    active true
+  end
 end
 
@@ -59,4 +76,7 @@
   end
   task automate.launch
+    active false
+  end
+  task automate.regular
     active false
   end
@@ -335,2 +355,78 @@
 end
 
+
+$automate_Nregular = 0
+task automate.regular
+  host         local
+
+  periods      -poll 1
+  periods      -exec 5
+  periods      -timeout 30
+  active       true
+  npending     1
+
+  task.exec
+    local Npage pageName
+
+    # how many pages are waiting to be started?
+    book npages automate -var Npage -key pantaskState INIT.REGULAR
+    if ($Npage == 0) 
+      if ($VERBOSE >= 2)
+        echo "no entries in INIT.REGULAR state"
+      end
+      break
+    end
+
+    # cycle over the number of INIT.REGULAR pages: no point to loop over the others
+    $automate_Nregular ++
+    if ($automate_Nregular >= $Npage) set automate_Nregular = 0
+
+    # search the automate book for an entry which is unstarted (state INIT.REGULAR) 
+    book getpage automate $automate_Nregular -var pageName -key pantaskState INIT.REGULAR
+    if ("$pageName" == "NULL") 
+      if ($VERBOSE >= 2)
+        echo "entry $automate_Nregular not in INIT.REGULAR state"
+      end
+      break 
+    end
+ 
+    book getword automate $pageName regular -var regularCommand
+    if (("$regularCommand" == "NULL") || ("$regularCommand" == "NONE"))
+      if ($VERBOSE >= 2)
+        echo "Warning: $pageName has no regular command"
+      end
+      break
+    end
+
+    book setword automate $pageName pantaskState RUN.REGULAR
+
+    if ($VERBOSE >= 2)
+      echo "starting automate regular for $pageName"
+      echo "command $regularCommand"
+    end
+
+    options $pageName
+    command $regularCommand
+  end
+
+  task.exit $EXIT_SUCCESS
+    local pageName Npage
+
+    $pageName = $options:0
+
+    book setword automate $pageName pantaskState INIT.REGULAR
+  end
+
+  # all failures here (what state?)
+  task.exit    default
+    showcommand failure
+    book setword automate $pageName pantaskState FAIL.REGULAR
+  end
+
+  # operation times out?
+  task.exit    timeout
+    showcommand timeout
+    book setword automate $pageName pantaskState INIT.REGULAR
+  end
+end
+
Index: trunk/ippTasks/simtest.auto
===================================================================
--- trunk/ippTasks/simtest.auto	(revision 18607)
+++ trunk/ippTasks/simtest.auto	(revision 18683)
@@ -58,4 +58,25 @@
 END
 
+### Stack automation???
+automate METADATA
+  name       STR STACK
+  regular    STR "stacktool -definebyquery -all -workdir file://@CWD@/stack -min_new 4 -min_frac 2 -select_good_frac_min 0.2 -dbname @DBNAME@"
+END
+
+### Diff automation???
+automate METADATA
+  name       STR DIFF
+  regular    STR "difftool -definebyquery -workdir file://@CWD@/diff -good_frac 0.2 -dbname @DBNAME@"
+END
+
+### Magic automation???
+automate METADATA
+  name       STR MAGIC
+  regular    STR "magictool -definebyquery -workdir file://@CWD@/magic -good_frac 0.2 -dbname @DBNAME@"
+END
+
+
+
+
 ### automate METADATA
 ###   name       STR OBJECT-r
Index: trunk/ippTasks/simtest.basic.config
===================================================================
--- trunk/ippTasks/simtest.basic.config	(revision 18607)
+++ trunk/ippTasks/simtest.basic.config	(revision 18683)
@@ -41,9 +41,9 @@
 
 ### Carina
-#  CENTER.RA  F32 270.75
-#  CENTER.DEC F32 -23.7
+  CENTER.RA  F32 270.75
+  CENTER.DEC F32 -23.7
 ### COSMOS field
-  CENTER.RA  F32 150.119167 
-  CENTER.DEC F32   2.205833
+#  CENTER.RA  F32 150.119167 
+#  CENTER.DEC F32   2.205833
 
   OFFSET.RA  F32 3600.0 # linear offset in arcsec (do not include cos(DEC) correction)
@@ -79,9 +79,9 @@
 
 ### Carina
-#  CENTER.RA  F32 270.75
-#  CENTER.DEC F32 -23.7
+  CENTER.RA  F32 270.75
+  CENTER.DEC F32 -23.7
 ### COSMOS field
-  CENTER.RA  F32 150.119167 
-  CENTER.DEC F32   2.205833
+#  CENTER.RA  F32 150.119167 
+#  CENTER.DEC F32   2.205833
 
   OFFSET.RA  F32 3600.0 # linear offset in arcsec (do not include cos(DEC) correction)
