Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

make s3del safer

  • Loading branch information...
commit eb0006626a6658963e30f6efa5f29b17db79d5f8 1 parent 9a2f402
Eliot authored August 22, 2012

Showing 1 changed file with 20 additions and 1 deletion. Show diff stats Hide diff stats

  1. 21  buildscripts/s3del.py
21  buildscripts/s3del.py
@@ -16,11 +16,30 @@
16 16
 
17 17
 def check_dir( bucket , prefix , todel ):
18 18
     
  19
+    deleteAll = False
  20
+
19 21
     for ( key , modify , etag , size ) in bucket.listdir( prefix=prefix ):
20 22
         if key.find( todel ) < 0:
21 23
             continue
22 24
         print( key )
23  
-        time.sleep( 2 )
  25
+
  26
+        if not deleteAll:
  27
+
  28
+            val = raw_input( "Delete (Y,y,n,N):" ).strip()
  29
+
  30
+            if val == "n":
  31
+                print( "skipping this one" )
  32
+                continue
  33
+            elif val == "N":
  34
+                break
  35
+
  36
+            if val == "Y":
  37
+                val = "y"
  38
+                deleteAll = True
  39
+                
  40
+            if val != "y":
  41
+                raise Exception( "invalid input :(" )
  42
+
24 43
         bucket.delete( key )
25 44
 
26 45
 def clean( todel ):

0 notes on commit eb00066

Please sign in to comment.
Something went wrong with that request. Please try again.