Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'rubygems'
- require 'aws/s3'
- proxy = {
- :host =>'host',
- :port => 3128,
- :user =>'user',
- :password =>'pass',
- }
- AWS::S3::Base.establish_connection!(
- :access_key_id =>'key',
- :secret_access_key =>'',
- :use_ssl => true,
- :proxy => proxy
- )
- o = AWS::S3::Bucket.objects(
- 'wezm-macpro-backup',
- :marker => %q|wmoore/Pictures/Aperture Library.aplibrary/Crystal & Lisa's Birthday.approject/2007-10-08 @ 05:29:54 PM - 1.apimportgroup/IMG_1543/Info.apmaster|,
- :max_keys => 2
- )
- o.each do |oo|
- puts oo.key
- end
- exit
- b = AWS::S3::Bucket.find('wezm-macpro-backup')
- o = b.objects
- c = 0
- File.open('s3_listing.txt', "w") do |f|
- while(o.size > 0)
- o.each do |obj|
- f.puts obj.key
- end
- c += o.size
- o = b.objects(:marker => o.last.key)
- puts c
- end
- end
Add Comment
Please, Sign In to add comment