Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Remeber that S3 Buckets need to be empty before they can be deleted. The good news is that most 3rd party tools automate this process. If you are running into problems with S3Fox, I recommend trying S3FM for GUI or S3Sync for command line. Amazon has a great article describing <a href="http://developer.amazonwebservices.com/connect/entry.jspa?externalID=931&amp;categoryID=100" rel="noreferrer">how to use S3Sync</a>. After setting up your variables, the key command is </p> <pre><code>./s3cmd.rb deleteall &lt;your bucket name&gt; </code></pre> <p>Deleting buckets with lots of individual files tends to crash a lot of S3 tools because they try to display a list of all files in the directory. You need to find a way to delete in batches. The best GUI tool I've found for this purpose is Bucket Explorer. It deletes files in a S3 bucket in 1000 file chunks and does not crash when trying to open large buckets like s3Fox and S3FM.</p> <p>I've also found a few scripts that you can use for this purpose. I haven't tried these scripts yet but they look pretty straightforward. </p> <p><strong>RUBY</strong></p> <pre><code>require 'aws/s3' AWS::S3::Base.establish_connection!( :access_key_id =&gt; 'your access key', :secret_access_key =&gt; 'your secret key' ) bucket = AWS::S3::Bucket.find('the bucket name') while(!bucket.empty?) begin puts "Deleting objects in bucket" bucket.objects.each do |object| object.delete puts "There are #{bucket.objects.size} objects left in the bucket" end puts "Done deleting objects" rescue SocketError puts "Had socket error" end end </code></pre> <p><strong>PERL</strong></p> <pre><code>#!/usr/bin/perl use Net::Amazon::S3; my $aws_access_key_id = 'your access key'; my $aws_secret_access_key = 'your secret access key'; my $increment = 50; # 50 at a time my $bucket_name = 'bucket_name'; my $s3 = Net::Amazon::S3-&gt;new({aws_access_key_id =&gt; $aws_access_key_id, aws_secret_access_key =&gt; $aws_secret_access_key, retry =&gt; 1, }); my $bucket = $s3-&gt;bucket($bucket_name); print "Incrementally deleting the contents of $bucket_name\n"; my $deleted = 1; my $total_deleted = 0; while ($deleted &gt; 0) { print "Loading up to $increment keys...\n"; $response = $bucket-&gt;list({'max-keys' =&gt; $increment, }) or die $s3-&gt;err . ": " . $s3-&gt;errstr . "\n"; $deleted = scalar(@{ $response-&gt;{keys} }) ; $total_deleted += $deleted; print "Deleting $deleted keys($total_deleted total)...\n"; foreach my $key ( @{ $response-&gt;{keys} } ) { my $key_name = $key-&gt;{key}; $bucket-&gt;delete_key($key-&gt;{key}) or die $s3-&gt;err . ": " . $s3-&gt;errstr . "\n"; } } print "Deleting bucket...\n"; $bucket-&gt;delete_bucket or die $s3-&gt;err . ": " . $s3-&gt;errstr; print "Done.\n"; </code></pre> <p>SOURCE: Tarkblog</p> <p>Hope this helps!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload