Skip to content

Instantly share code, notes, and snippets.

@commuterjoy
Last active August 29, 2015 13:58
Show Gist options
  • Save commuterjoy/9977285 to your computer and use it in GitHub Desktop.
Save commuterjoy/9977285 to your computer and use it in GitHub Desktop.
# transfer locally cached resources to s3 (single threaded)
s3:
s3cmd put -m text/html --add-header 'Cache-Control: max-age=60' --acl-public --recursive target/cache/www.theguardian.com/books s3://aws-frontend-archive/www.theguardian.com/
# https://github.com/chrishein/s3_uploader - this is nice
require 'rubygems'
require 's3_uploader'
S3Uploader.upload_directory('target/cache/www.theguardian.com', 'aws-frontend-archive',
{
:destination_dir => 'www.theguardian.com',
:region => 'eu-west-1',
:threads => 15,
:metadata => {
'Cache-Control' => 'max-age=60',
'Content-Type' => 'text/html',
'x-amz-acl' => 'public-read'
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment