Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Adding a reduced redundancy storage option (might need to re-setup)

  • Loading branch information...
commit 11bebc716b7be41176d591e0c20b42e11150db99 1 parent d3692a7
Mitko Koparov authored
Showing with 5 additions and 2 deletions.
  1. +2 −0  lib/ssync/setup.rb
  2. +3 −2 lib/ssync/sync.rb
2  lib/ssync/setup.rb
View
@@ -62,6 +62,8 @@ def run!
config[:s3_file_path] = ask config[:s3_file_path], "What is the destination path on S3? (Leave blank if you wish to have a relative path)"
config[:find_options] = ask config[:find_options], "Do you have any options for 'find'? (e.g. \! -path *.git*)."
+
+ config[:reduced_redundancy] = ask config[:reduced_redundancy], "Do you want to use reduced redundancy storage (yes/no)?"
config[:access] = ask config[:access], "What access control policies do you wish to use? (p)rivate [default], public_(r)ead, public_read_(w)rite or (a)uthenticated_read?"
config[:access] = CANNED_POLICIES.keys.include?(config[:access].to_sym) ? CANNED_POLICIES[ config[:access].to_sym ] : :private
5 lib/ssync/sync.rb
View
@@ -117,9 +117,10 @@ def push_file(file)
# xfer speed, logging, etc can occur in this method
display "Pushing '#{file[:path]}' to #{relative_file_path} ..."
+ options = {:access => read_config[:access]}
+ options['x-amz-storage-class'] = 'REDUCED_REDUNDANCY' if read_config[:reduced_redundancy]=='yes'
-
- AWS::S3::S3Object.store(relative_file_path, open(file[:path]), read_config[:aws_dest_bucket], :access => read_config[:access])
+ AWS::S3::S3Object.store(relative_file_path, open(file[:path]), read_config[:aws_dest_bucket], options)
rescue
e "Could not push '#{file[:path]}': #{$!.inspect}"
end
Please sign in to comment.
Something went wrong with that request. Please try again.