Index: trunk/Nebulous/bin/neb-rm
===================================================================
--- trunk/Nebulous/bin/neb-rm	(revision 26292)
+++ trunk/Nebulous/bin/neb-rm	(revision 26333)
@@ -19,4 +19,5 @@
     $force,
     $move,
+    $invalid,
     $server,
 );
@@ -27,4 +28,5 @@
     'force|f'       => \$force,
     'move|m'        => \$move,
+    'invalid|i'     => \$invalid,
     'server|s=s'    => \$server,
 ) || pod2usage( 2 );
@@ -42,5 +44,5 @@
 foreach my $key (@ARGV) {
     unless (defined $move) {
-        $neb->delete($key, $force) or warn "failed to delete key: $key";
+        $neb->delete($key, $force,$invalid) or warn "failed to delete key: $key";
     } else {
         $neb->move($key, "${key}.rm") or warn "failed to move key: $key";
@@ -80,4 +82,10 @@
 When set, this flag causes C<<key>> to be renamed to C<<key>.rm> instead of
 being deleted.
+
+Optional.
+
+=item * --invalid|-i
+
+When set, unavailable instances of C<<key>> will be removed from the nebulous database.
 
 Optional.
Index: trunk/Nebulous/lib/Nebulous/Client.pm
===================================================================
--- trunk/Nebulous/lib/Nebulous/Client.pm	(revision 26292)
+++ trunk/Nebulous/lib/Nebulous/Client.pm	(revision 26333)
@@ -755,4 +755,9 @@
             optional    => 1,
         },
+        {
+	    #find_invalid
+	    type        => SCALAR|UNDEF,
+            optional    => 1,
+	},
     );
 
@@ -951,5 +956,5 @@
     my $self = shift;
 
-    my ($key, $force) = validate_pos( @_,
+    my ($key, $force, $invalid) = validate_pos( @_,
         {
             type        => SCALAR,
@@ -965,9 +970,26 @@
             },
         },
-    );
-
-    $log->debug( "entered - @_" );
-
-    my $locations = $self->find_instances( $key, 'any' );
+        {
+            type        => BOOLEAN,
+            optional    => 1,
+            default     => undef,
+            callbacks   => {
+                'is boolean' => sub {
+                    $_[0] == 0 or $_[0] == 1 or $_[0] == undef;
+                },
+            },
+        },
+    );
+
+    $log->debug( "entered - @_" );
+
+
+    my $locations;
+    if ($invalid) {
+	$locations = $self->find_instances( $key, 'any', 'find them all');
+    }
+    else {
+	$locations = $self->find_instances( $key, 'any' );
+    }
 
     return undef unless $locations;
