Index: trunk/ippScripts/scripts/ipp_cleanup.pl
===================================================================
--- trunk/ippScripts/scripts/ipp_cleanup.pl	(revision 22433)
+++ trunk/ippScripts/scripts/ipp_cleanup.pl	(revision 22750)
@@ -45,6 +45,8 @@
     defined $mode;
 
-# $mode must be one of "goto_cleaned" or "goto_purged"
-unless (($mode eq "goto_cleaned") || ($mode eq "goto_purged")) {
+# $mode must be one of "goto_cleaned", "goto_scrubbed", or "goto_purged"
+# goto_cleaned and goto_scrubbed both result in 'cleaned': scrubbed allows chips without config files to 
+# be cleaned (they cannot be recovered, but the small data is left behind)
+unless (($mode eq "goto_cleaned") || ($mode eq "goto_scrubbed") || ($mode eq "goto_purged")) {
     die "invalid cleanup mode $mode\n";    
 }
@@ -92,4 +94,5 @@
 
         # don't clean up unless the data needed to update is available
+	# modes goto_purged and goto_scrubbed will remove files even if the config is non-existent
         if ($mode eq "goto_cleaned") {
             my $config_file = $ipprc->filename("PPIMAGE.CONFIG", $path_base, $class_id);
@@ -133,5 +136,7 @@
             if ($mode eq "goto_purged") {
                 $command .= " -topurgedimfile";
-            } else {
+            } elsif ($mode eq "goto_scrubbed") {
+                $command .= " -tocleanedimfile_from_scrubbed";
+	    } else {
                 $command .= " -tocleanedimfile";
             }
@@ -145,4 +150,5 @@
 	    }
         } else {
+	    # if an error happens for one chip, the chipRun will stay in goto_*, but the chips will stop be run
 	    my $command = "$chiptool -updateprocessedimfile -chip_id $stage_id -class_id $class_id -code 1";
 	    $command .= " -dbname $dbname" if defined $dbname;
@@ -156,6 +162,8 @@
 	}
     }
-
-} elsif ($stage eq "camera") {
+    exit 0;
+} 
+
+if ($stage eq "camera") {
     die "--stage_id required for stage camera\n" if !$stage_id;
     # this stage uses 'camtool'
@@ -236,5 +244,7 @@
     }
     exit 0;
-} elsif ($stage eq "warp") {
+} 
+
+if ($stage eq "warp") {
     die "--stage_id required for stage warp\n" if !$stage_id;
     # this stage uses 'warptool'
