diff --git a/s3sync.rb b/s3sync.rb index c80e828..b8fe168 100644 --- a/s3sync.rb +++ b/s3sync.rb @@ -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) @@ -80,7 +82,7 @@ def S3sync.usage(message = nil) --ssl -s --recursive -r --delete --public-read -p --expires="" --cache-control="" --exclude="" --progress --debug -d - --make-dirs --no-md5 + --make-dirs --no-md5 --reduced-redundancy --server-side-encryption One of or must be of S3 format, the other a local path. Reminders: * An S3 formatted item with bucket 'mybucket' and prefix 'mypre' looks like: @@ -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 != ''