Index: trunk/ippTasks/destreak.pro
===================================================================
--- trunk/ippTasks/destreak.pro	(revision 25463)
+++ trunk/ippTasks/destreak.pro	(revision 25465)
@@ -13,4 +13,5 @@
 ### indexes into Database lists
 $magicToDS_DB = 0
+$magicDSAdvance_DB = 0
 $magicDSToRevert_DB = 0
 $magicDSCompletedRevert_DB = 0
@@ -41,4 +42,7 @@
 ### Turn tasks on
 macro destreak.on
+    # destreak and revert should not run at the same time
+    destreak.revert.off
+
     task destreak.load
         active true
@@ -47,7 +51,13 @@
         active true
     end
+    task destreak.advance
+        active true
+    end
 end
 
 macro destreak.revert.on
+    # destreak and revert should not run at the same time
+    destreak.off
+
     task destreak.revert.load
         active true
@@ -67,4 +77,7 @@
     end
     task destreak.run
+        active false
+    end
+    task destreak.advance
         active false
     end
@@ -100,6 +113,6 @@
   npending     1
 
-  stdout NULL
-  stderr $LOGDIR/magic.destreak.log
+#  stdout NULL
+#  stderr $LOGSUBDIR/destreak.load.log
 
   task.exec
@@ -233,4 +246,50 @@
 end
 
+task	       destreak.advance
+    # task to finish processing for magicDSRuns 
+  host         local
+
+  periods      -poll $LOADPOLL
+  #periods      -exec $LOADEXEC
+  periods      -exec 30
+  periods      -timeout 20
+  npending     1
+
+#  stdout NULL
+#  stderr $LOGSUBDIR/destreak.advance.log
+
+  task.exec
+    $run = magicdstool -advancerun 
+    if ($DB:n != 0)
+
+      $run = $run -dbname $DB:$magicDSAdvance_DB
+
+      $magicDSAdvance_DB ++
+      if ($magicDSAdvance_DB >= $DB:n) set magicDSAdvance_DB = 0
+    end
+    add_poll_args run
+    add_poll_labels run
+    command $run
+  end
+
+  # success
+  task.exit    0
+  end
+
+  # locked list
+  task.exit    default
+    showcommand failure
+  end
+
+  task.exit    crash
+    showcommand crash
+  end
+
+  # operation times out?
+  task.exit    timeout
+    showcommand timeout
+  end
+end
+
 task	       destreak.revert.load
   host         local
@@ -386,5 +445,5 @@
 
   stdout NULL
-  stderr $LOGSUBDIR/destreak.completed.revert
+  stderr $LOGSUBDIR/destreak.completed.revert.log
 
   task.exec
@@ -398,4 +457,5 @@
       $run = $run -dbname $DB:$magicDSCompletedRevert_DB
 
+      $magicDSCompletedRevert_DB ++
       if ($magicDSCompletedRevert_DB >= $DB:n) set magicDSCompletedRevert_DB = 0
     end
