Index: trunk/ippTools/share/difftool_pendingcleanuprun.sql
===================================================================
--- trunk/ippTools/share/difftool_pendingcleanuprun.sql	(revision 24185)
+++ trunk/ippTools/share/difftool_pendingcleanuprun.sql	(revision 24186)
@@ -9,5 +9,5 @@
     USING(diff_id)
 JOIN warpSkyfile
-    ON  diffInputSkyfile.warp_id    = warpSkyfile.warp_id
+    ON  diffInputSkyfile.warp1    = warpSkyfile.warp_id
     AND diffInputSkyfile.skycell_id = warpSkyfile.skycell_id
     AND diffInputSkyfile.tess_id    = warpSkyfile.tess_id
@@ -23,3 +23,3 @@
     USING(exp_id)
 WHERE
-    diffRun.state = 'goto_cleaned'
+    (diffRun.state = 'goto_cleaned' OR diffRun.state = 'goto_scrubbed' OR diffRun.state = 'goto_purged')
Index: trunk/ippTools/share/difftool_pendingcleanupskyfile.sql
===================================================================
--- trunk/ippTools/share/difftool_pendingcleanupskyfile.sql	(revision 24185)
+++ trunk/ippTools/share/difftool_pendingcleanupskyfile.sql	(revision 24186)
@@ -9,4 +9,7 @@
     USING(diff_id)
 WHERE
-    diffRun.state = 'goto_cleaned'
-    AND diffSkyfile.data_state = 'full'
+   ((diffRun.state = 'goto_cleaned'  AND diffSkyfile.data_state = 'full')
+    OR
+    (diffRun.state = 'goto_scrubbed' AND diffSkyfile.data_state != 'scrubbed')
+    OR
+    (diffRun.state = 'goto_purged'   AND diffSkyfile.data_state != 'purged'))
Index: trunk/ippTools/share/stacktool_pendingcleanuprun.sql
===================================================================
--- trunk/ippTools/share/stacktool_pendingcleanuprun.sql	(revision 24185)
+++ trunk/ippTools/share/stacktool_pendingcleanuprun.sql	(revision 24186)
@@ -27,3 +27,3 @@
      USING (exp_id)
 WHERE
-    stackRun.state = 'goto_cleaned'
+    (stackRun.state = 'goto_cleaned' OR stackRun.state = 'goto_scrubbed' OR stackRun.state = 'goto_purged')
Index: trunk/ippTools/share/stacktool_pendingcleanupskyfile.sql
===================================================================
--- trunk/ippTools/share/stacktool_pendingcleanupskyfile.sql	(revision 24185)
+++ trunk/ippTools/share/stacktool_pendingcleanupskyfile.sql	(revision 24186)
@@ -4,8 +4,9 @@
     stackRun.workdir,
     stackRun.dvodb,
-    stackRun.tess_id
+    stackRun.tess_id,
+    stackRun.skycell_id
 FROM stackRun
 JOIN stackSumSkyfile
     USING(stack_id)
 WHERE
-    stackRun.state = 'goto_cleaned'
+    (stackRun.state = 'goto_cleaned' OR stackRun.state = 'goto_scrubbed' OR stackRun.state = 'goto_purged')
Index: trunk/ippTools/share/warptool_pendingcleanupskyfile.sql
===================================================================
--- trunk/ippTools/share/warptool_pendingcleanupskyfile.sql	(revision 24185)
+++ trunk/ippTools/share/warptool_pendingcleanupskyfile.sql	(revision 24186)
@@ -12,5 +12,5 @@
    ((warpRun.state = 'goto_cleaned'  AND warpSkyfile.data_state = 'full')
     OR
-    (warpRun.state = 'goto_scrubbed' AND warpSkyfile.data_state = 'full')
+    (warpRun.state = 'goto_scrubbed' AND warpSkyfile.data_state != 'scrubbed')
     OR
     (warpRun.state = 'goto_purged'   AND warpSkyfile.data_state != 'purged'))
Index: trunk/ippTools/src/difftool.c
===================================================================
--- trunk/ippTools/src/difftool.c	(revision 24185)
+++ trunk/ippTools/src/difftool.c	(revision 24186)
@@ -1575,5 +1575,5 @@
 
     psMetadata *where = psMetadataAlloc();
-    pxAddLabelSearchArgs (config, where, "-label", "label", "==");
+    pxAddLabelSearchArgs (config, where, "-label", "diffRun.label", "==");
 
     psString query = pxDataGet("difftool_pendingcleanuprun.sql");
@@ -1640,5 +1640,5 @@
         PXOPT_COPY_S64(config->args, where, "-diff_id", "diff_id", "==");
     }
-    pxAddLabelSearchArgs (config, where, "-label", "label", "==");
+    pxAddLabelSearchArgs (config, where, "-label", "diffRun.label", "==");
 
     psString query = pxDataGet("difftool_pendingcleanupskyfile.sql");
Index: trunk/ippTools/src/faketool.c
===================================================================
--- trunk/ippTools/src/faketool.c	(revision 24185)
+++ trunk/ippTools/src/faketool.c	(revision 24186)
@@ -895,5 +895,5 @@
 
     psMetadata *where = psMetadataAlloc();
-    pxAddLabelSearchArgs (config, where, "-label", "label", "==");
+    pxAddLabelSearchArgs (config, where, "-label", "fakeRun.label", "==");
 
     psString query = pxDataGet("faketool_pendingcleanuprun.sql");
Index: trunk/ippTools/src/stacktool.c
===================================================================
--- trunk/ippTools/src/stacktool.c	(revision 24185)
+++ trunk/ippTools/src/stacktool.c	(revision 24186)
@@ -991,5 +991,5 @@
 
     psMetadata *where = psMetadataAlloc();
-    pxAddLabelSearchArgs (config, where, "-label", "label", "==");
+    pxAddLabelSearchArgs (config, where, "-label", "stackRun.label", "==");
 
     psString query = pxDataGet("stacktool_pendingcleanuprun.sql");
@@ -1055,5 +1055,5 @@
         PXOPT_COPY_S64(config->args, where, "-stack_id", "stack_id", "==");
     }
-    pxAddLabelSearchArgs (config, where, "-label", "label", "==");
+    pxAddLabelSearchArgs (config, where, "-label", "stackRun.label", "==");
 
     psString query = pxDataGet("stacktool_pendingcleanupskyfile.sql");
Index: trunk/ippTools/src/warptool.c
===================================================================
--- trunk/ippTools/src/warptool.c	(revision 24185)
+++ trunk/ippTools/src/warptool.c	(revision 24186)
@@ -1394,5 +1394,5 @@
 
     psMetadata *where = psMetadataAlloc();
-    pxAddLabelSearchArgs (config, where, "-label", "label", "==");
+    pxAddLabelSearchArgs (config, where, "-label", "warpRun.label", "==");
 
     psString query = pxDataGet("warptool_pendingcleanuprun.sql");
@@ -1457,5 +1457,5 @@
     psMetadata *where = psMetadataAlloc();
     PXOPT_COPY_S64(config->args, where, "-warp_id", "warp_id", "==");
-    pxAddLabelSearchArgs (config, where, "-label", "label", "==");
+    pxAddLabelSearchArgs (config, where, "-label", "warpRun.label", "==");
 
     psString query = pxDataGet("warptool_pendingcleanupskyfile.sql");
