Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added reduced redundancy and server side encryption flags #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions s3sync.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ def S3sync.main
[ '--cache-control', GetoptLong::REQUIRED_ARGUMENT ],
[ '--exclude', GetoptLong::REQUIRED_ARGUMENT ],
[ '--make-dirs', GetoptLong::NO_ARGUMENT ],
[ '--no-md5', GetoptLong::NO_ARGUMENT ]
[ '--no-md5', GetoptLong::NO_ARGUMENT ] ,
[ '--reduced-redundancy', GetoptLong::NO_ARGUMENT],
[ '--server-side-encryption', GetoptLong::NO_ARGUMENT]
)

def S3sync.usage(message = nil)
Expand All @@ -80,7 +82,7 @@ def S3sync.usage(message = nil)
--ssl -s --recursive -r --delete
--public-read -p --expires="<exp>" --cache-control="<cc>"
--exclude="<regexp>" --progress --debug -d
--make-dirs --no-md5
--make-dirs --no-md5 --reduced-redundancy --server-side-encryption
One of <source> or <destination> must be of S3 format, the other a local path.
Reminders:
* An S3 formatted item with bucket 'mybucket' and prefix 'mypre' looks like:
Expand Down Expand Up @@ -505,6 +507,8 @@ def updateFrom(fromNode)
headers['x-amz-acl'] = 'public-read' if $S3syncOptions['--public-read']
headers['Expires'] = $S3syncOptions['--expires'] if $S3syncOptions['--expires']
headers['Cache-Control'] = $S3syncOptions['--cache-control'] if $S3syncOptions['--cache-control']
headers['x-amz-storage-class'] = 'REDUCED_REDUNDANCY' if $S3syncOptions['--reduced-redundancy']
headers['x-amz-server-side-encryption'] = 'AES256' if $S3syncOptions['--server-side-encryption']
fType = @path.split('.').last
debug("File extension: #{fType}")
if defined?($mimeTypes) and fType != '' and (mType = $mimeTypes[fType]) and mType != ''
Expand Down