diff --git a/lib/dump_rake.rb b/lib/dump_rake.rb
index <HASH>..<HASH> 100644
--- a/lib/dump_rake.rb
+++ b/lib/dump_rake.rb
@@ -63,6 +63,10 @@ class DumpRake
   end
 
   def self.cleanup(options = {})
+    unless options[:leave].nil? || /^\d+$/ === options[:leave] || options[:leave].downcase == 'none'
+      raise 'LEAVE should be number or "none"'
+    end
+
     to_delete = []
 
     all_dumps = Dump.list(options.merge(:all => true))
complain if LEAVE is not none and is not a number