Created
December 7, 2011 20:34
-
-
Save msaffitz/1444519 to your computer and use it in GitHub Desktop.
Emit all objects in an S3 account
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'aws-sdk' | |
puts "Connecting to S3 ... " | |
start_time = Time.now | |
s3 = AWS::S3.new(access_key_id: (ARGV[0] || ENV['S3_ACCESS_KEY']), | |
secret_access_key: (ARGV[1] || ENV['S3_SECRET_KEY']) ) | |
s3.buckets.each do |bucket| | |
bucket.objects.each do |object| | |
puts "#{bucket.name}::#{object.key}" | |
end | |
end | |
end_time = Time.now | |
puts "Complete. #{ (end_time - start_time).to_i }s elapsed." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment