Index: trunk/ippTools/share/chiptool_pendingcleanupimfile.sql
===================================================================
--- trunk/ippTools/share/chiptool_pendingcleanupimfile.sql	(revision 22718)
+++ trunk/ippTools/share/chiptool_pendingcleanupimfile.sql	(revision 22751)
@@ -15,3 +15,5 @@
     ((chipRun.state = 'goto_cleaned' AND chipProcessedImfile.data_state = 'full')
 OR 
+    (chipRun.state = 'goto_scrubbed' AND chipProcessedImfile.data_state = 'full')
+OR 
     (chipRun.state = 'goto_purged' AND chipProcessedImfile.data_state != 'purged'))
Index: trunk/ippTools/share/chiptool_pendingcleanuprun.sql
===================================================================
--- trunk/ippTools/share/chiptool_pendingcleanuprun.sql	(revision 22718)
+++ trunk/ippTools/share/chiptool_pendingcleanuprun.sql	(revision 22751)
@@ -7,3 +7,3 @@
 USING (exp_id)
 WHERE
-    (chipRun.state = 'goto_cleaned' OR chipRun.state = 'goto_purged')
+    (chipRun.state = 'goto_cleaned' OR chipRun.state = 'goto_scrubbed' OR chipRun.state = 'goto_purged')
Index: trunk/ippTools/src/chiptool.c
===================================================================
--- trunk/ippTools/src/chiptool.c	(revision 22718)
+++ trunk/ippTools/src/chiptool.c	(revision 22751)
@@ -52,4 +52,5 @@
 static bool runMode(pxConfig *config);
 static bool tocleanedimfileMode(pxConfig *config);
+static bool tocleanedimfile_from_scrubbedMode(pxConfig *config);
 static bool tofullimfileMode(pxConfig *config);
 static bool topurgedimfileMode(pxConfig *config);
@@ -91,4 +92,5 @@
         MODECASE(CHIPTOOL_MODE_RUN,                     runMode);
         MODECASE(CHIPTOOL_MODE_TOCLEANEDIMFILE,         tocleanedimfileMode);
+        MODECASE(CHIPTOOL_MODE_TOCLEANEDIMFILE_FROM_SCRUBBED, tocleanedimfile_from_scrubbedMode);
         MODECASE(CHIPTOOL_MODE_TOFULLIMFILE,            tofullimfileMode);
         MODECASE(CHIPTOOL_MODE_TOPURGEDIMFILE,          topurgedimfileMode);
@@ -1245,4 +1247,8 @@
     return change_imfile_data_state(config, "cleaned", "goto_cleaned");
 }
+static bool tocleanedimfile_from_scrubbedMode(pxConfig *config)
+{
+    return change_imfile_data_state(config, "cleaned", "goto_scrubbed");
+}
 static bool tofullimfileMode(pxConfig *config)
 {
Index: trunk/ippTools/src/chiptool.h
===================================================================
--- trunk/ippTools/src/chiptool.h	(revision 22718)
+++ trunk/ippTools/src/chiptool.h	(revision 22751)
@@ -43,4 +43,5 @@
     CHIPTOOL_MODE_RUN,
     CHIPTOOL_MODE_TOCLEANEDIMFILE,
+    CHIPTOOL_MODE_TOCLEANEDIMFILE_FROM_SCRUBBED,
     CHIPTOOL_MODE_TOFULLIMFILE,
     CHIPTOOL_MODE_TOPURGEDIMFILE,
Index: trunk/ippTools/src/chiptoolConfig.c
===================================================================
--- trunk/ippTools/src/chiptoolConfig.c	(revision 22718)
+++ trunk/ippTools/src/chiptoolConfig.c	(revision 22751)
@@ -234,4 +234,9 @@
     psMetadataAddStr(tocleanedimfileArgs, PS_LIST_TAIL, "-class_id",  0,        "class ID to update", NULL);
 
+    // -tocleanedimfile_from_scrubbed
+    psMetadata *tocleanedimfile_from_scrubbedArgs = psMetadataAlloc();
+    psMetadataAddS64(tocleanedimfile_from_scrubbedArgs, PS_LIST_TAIL, "-chip_id", 0,          "chip ID to update", 0);
+    psMetadataAddStr(tocleanedimfile_from_scrubbedArgs, PS_LIST_TAIL, "-class_id",  0,        "class ID to update", NULL);
+
     // -tofullimfile
     psMetadata *tofullimfileArgs = psMetadataAlloc();
@@ -275,4 +280,5 @@
     PXOPT_ADD_MODE("-run",                  "show runs",                            CHIPTOOL_MODE_RUN,                  runArgs);
     PXOPT_ADD_MODE("-tocleanedimfile",      "set imfile state to cleaned",          CHIPTOOL_MODE_TOCLEANEDIMFILE,      tocleanedimfileArgs);
+    PXOPT_ADD_MODE("-tocleanedimfile_from_scrubbed", "set imfile state to cleaned (for goto_scrubbed)", CHIPTOOL_MODE_TOCLEANEDIMFILE_FROM_SCRUBBED, tocleanedimfile_from_scrubbedArgs);
     PXOPT_ADD_MODE("-tofullimfile",         "set imfile state to full",              CHIPTOOL_MODE_TOFULLIMFILE,         tofullimfileArgs);
     PXOPT_ADD_MODE("-topurgedimfile",       "set imfile state to purged",            CHIPTOOL_MODE_TOPURGEDIMFILE,       topurgedimfileArgs);
Index: trunk/ippTools/src/pxtools.c
===================================================================
--- trunk/ippTools/src/pxtools.c	(revision 22718)
+++ trunk/ippTools/src/pxtools.c	(revision 22751)
@@ -30,6 +30,4 @@
     PS_ASSERT_PTR_NON_NULL(state, false);
     
-    // XXX replace strncmp with strcmp
-
     if (!strcmp(state, "new")) return true;
     if (!strcmp(state, "reg")) return true;
@@ -38,4 +36,5 @@
     if (!strcmp(state, "wait")) return true;
     if (!strcmp(state, "goto_cleaned")) return true;
+    if (!strcmp(state, "goto_scrubbed")) return true;
     if (!strcmp(state, "cleaned")) return true;
     if (!strcmp(state, "update")) return true;
@@ -45,2 +44,5 @@
     return false;
 }
+
+// goto_scrubbed is similar to cleaned, but allows files to be removed even if the config
+// files is missing
