-
-
Save drunkhacker/5069147 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 'fog' | |
conn = Fog::Storage.new(:provider => 'AWS') | |
conn.get_bucket("doors-and-dots").body["Contents"].each do |h| | |
key = h["Key"] | |
if key.match /square100\.[a-z]+$/ | |
puts "processing #{key}" | |
obj = conn.get_object("doors-and-dots", key) | |
newkey = key.gsub /square100/, 'square200' | |
conn.put_object("doors-and-dots", newkey, obj.body, {"x-amz-acl"=>"public-read", "Content-Type"=>"image/jpeg"}) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
doors-and-dots bucket에 있는 square100을 square200 이름으로 복사.