Index: /trunk/ippScripts/scripts/ipp_cleanup.pl
===================================================================
--- /trunk/ippScripts/scripts/ipp_cleanup.pl	(revision 35027)
+++ /trunk/ippScripts/scripts/ipp_cleanup.pl	(revision 35028)
@@ -65,4 +65,10 @@
         &my_die("Unable to redirect ouput", $stage, $stage_id, $PS_EXIT_UNKNOWN_ERROR) if $logfile;
 
+
+my $hostname = `hostname`;
+chomp $hostname;
+print STDERR "starting cleanup for $stage $stage_id on $hostname\n" ;
+
+my $nebulous_server;
 
 my $bzip2 = can_run('bzip2') or die 'cannot find bzip2\n';
@@ -2280,9 +2286,24 @@
     if (my $resolved = $ipprc->file_resolve($filename)) {
         my $bzip2_filename = $filename . '.bz2';
-        if ($ipprc->file_exists($bzip2_filename)) {
-            $ipprc->kill_file($bzip2_filename);
-        }
+	if (file_scheme($bzip2_filename) eq 'neb') {
+	    # XXX: GRRRR $ipprc->file_exists() returns false if storage object exists but instance has
+	    # size of zero
+	    $nebulous_server = $ipprc->nebulous() if !$nebulous_server;
+	    if ($nebulous_server->storage_object_exists($bzip2_filename)) {
+		print STDERR "$bzip2_filename exists, killing\n";
+                $ipprc->kill_file($bzip2_filename);
+	    } else {
+	        print STDERR "$bzip2_filename does not exist\n" if $very_verbose;
+	    }
+	} else {
+	    if ($ipprc->file_exists($bzip2_filename)) {
+	        print STDERR "$bzip2_filename exists, killing\n";
+	        $ipprc->kill_file($bzip2_filename);
+	    } else {
+	        print STDERR "$bzip2_filename does not exist\n" if $very_verbose;
+	    }
+	}
         my $bzip2_file = $ipprc->file_create($bzip2_filename);
-        my_die("Unable to create $bzip2_filename", $stage_id, $PS_EXIT_SYS_ERROR) unless $bzip2_file;
+        my_die("Unable to create $bzip2_filename", $stage_id, $stage_id, $PS_EXIT_SYS_ERROR) unless $bzip2_file;
 
         my $command = "$bzip2 < $resolved > $bzip2_file";
