Guest User

Untitled

a guest
Mar 5th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. require 'rubygems'
  2. require 'aws/s3'
  3.  
  4. proxy = {
  5. :host =>'host',
  6. :port => 3128,
  7. :user =>'user',
  8. :password =>'pass',
  9. }
  10.  
  11. AWS::S3::Base.establish_connection!(
  12. :access_key_id =>'key',
  13. :secret_access_key =>'',
  14. :use_ssl => true,
  15. :proxy => proxy
  16. )
  17.  
  18. o = AWS::S3::Bucket.objects(
  19. 'wezm-macpro-backup',
  20. :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|,
  21. :max_keys => 2
  22. )
  23. o.each do |oo|
  24. puts oo.key
  25. end
  26.  
  27. exit
  28.  
  29. b = AWS::S3::Bucket.find('wezm-macpro-backup')
  30. o = b.objects
  31.  
  32. c = 0
  33. File.open('s3_listing.txt', "w") do |f|
  34. while(o.size > 0)
  35. o.each do |obj|
  36. f.puts obj.key
  37. end
  38. c += o.size
  39. o = b.objects(:marker => o.last.key)
  40. puts c
  41. end
  42. end
Add Comment
Please, Sign In to add comment