Index: trunk/ippTasks/pstamp.pro
===================================================================
--- trunk/ippTasks/pstamp.pro	(revision 25520)
+++ trunk/ippTasks/pstamp.pro	(revision 25549)
@@ -8,4 +8,5 @@
 $pstampJob_DB = 0
 $pstampFin_DB = 0
+$pstampRev_DB = 0
 
 # set PS_DBSERVER if postage stamp database host is not the same as the value for DBSERVER in site.config
@@ -52,5 +53,9 @@
         active true
     end
-end
+    task pstamp.job.revert
+        active true
+    end
+end
+
 
 macro pstamp.off
@@ -75,4 +80,18 @@
     end
     task pstamp.job.run
+        active false
+    end
+    task pstamp.job.revert
+        active false
+    end
+end
+
+macro pstamp.revert.on
+    task pstamp.job.revert
+        active true
+    end
+end
+macro pstamp.revert.off
+    task pstamp.job.revert
         active false
     end
@@ -430,2 +449,42 @@
     end
 end
+
+task pstamp.job.revert
+    host        local
+
+    periods     -poll $LOADPOLL
+    periods     -exec 180
+    periods     -timeout 300
+    npending    1
+
+    task.exec
+        $run = pstamptool -revertjob -all
+        if ($DB:n == 0)
+            option DEFAULT
+        else 
+            $run = $run $PS_DBSERVER -dbname $DB:$pstampRev_DB
+            $pstampRev_DB ++
+            if ($pstampRev_DB >= $DB:n) set pstampRev_DB = 0
+        end
+        add_poll_args run
+        # add_poll_labels run
+        command $run
+    end
+
+    task.exit $EXIT_SUCCESS
+        # nothing to do
+    end
+
+    task.exit   default
+        showcommand failure
+    end
+
+    task.exit   crash
+        showcommand crash
+    end
+
+    task.exit   timeout
+        showcommand timeout
+    end
+end
+
