Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions s3nukem
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ end

access_key = nil
secret_key = nil
empty_only = false
thread_count = 10
max_queue = 10 * 1000
STDOUT.sync = true
Expand All @@ -45,6 +46,10 @@ begin
'--secret SECRET',
String,
'Amazon Secret Key (required)') {|key| secret_key = key}
opts.on('-e',
'--empty',
FalseClass,
'If set, we just empty the bucket but dont delete it') {|val| empty_only = true}
opts.on('-t',
'--threads COUNT',
Integer,
Expand Down Expand Up @@ -150,7 +155,12 @@ buckets.each do |bucket|
end
end

# Clean up any stragglers and kill the bucket
puts "Bucket #{bucket} deleted!" if mains3.force_delete_bucket(bucket)
puts
if empty_only == false
# Clean up any stragglers and kill the bucket
puts "Bucket #{bucket} deleted!" if mains3.force_delete_bucket(bucket)
puts
else
puts "-e flag specified, bucket not deleted but should now be empty."
puts
end
end