Index: trunk/ippTasks/nightly_stacks.pro
===================================================================
--- trunk/ippTasks/nightly_stacks.pro	(revision 28211)
+++ trunk/ippTasks/nightly_stacks.pro	(revision 28222)
@@ -5,4 +5,5 @@
 macro nightly.stacks.on
     ns.initday.on
+    ns.detrends.off
     ns.registration.on
     ns.burntool.on
@@ -13,4 +14,5 @@
 macro nightly.stacks.off
     ns.initday.off
+    ns.detrends.off
     ns.registration.off
     ns.burntool.off
@@ -21,4 +23,5 @@
 macro ns.on
     ns.initday.on
+    ns.detrends.off
     ns.registration.on
     ns.burntool.on
@@ -29,4 +32,5 @@
 macro ns.off
     ns.initday.off
+    ns.detrends.off
     ns.registration.off
     ns.burntool.off
@@ -41,4 +45,10 @@
 end
 
+macro ns.detrends.on
+  task ns.detrends.load
+    active true
+  end
+end
+
 macro ns.registration.on
   task ns.registration.load
@@ -76,4 +86,10 @@
 macro ns.initday.off
   task ns.initday.load
+    active false
+  end
+end
+
+macro ns.detrends.off
+  task ns.detrends.load
     active false
   end
@@ -186,4 +202,39 @@
   #operation times out?
   task.exit    timeout
+    showcommand timeout
+  end
+end
+
+#
+# Queue off any possible detrend verification runs
+#
+task              ns.detrends.load
+  host            local
+  periods         -poll $LOADPOLL
+  periods         -exec $LOADEXEC
+  periods         -timeout 30
+  trange          23:00:00 24:00:00 -nmax 1
+  npending        1
+
+  task.exec
+    stdout $LOGDIR/ns.detrends.log
+    stdout $LOGDIR/ns.detrends.log
+    $today = `date +%Y-%m-%d`
+
+    command automate_stacks.pl --queue_detrends --date $today
+  end
+  
+  task.exit       0
+    # nothign to do here
+  end
+  # locked list
+  task.exit       default
+    showcommand failure
+  end
+  task.exit       crash
+    showcommand crash
+  end
+  # operation times out
+  task.exit       timeout
     showcommand timeout
   end
