-
-
Save sdepold/436072 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
ec2-add-keypair <name>-keypair | |
# copy the result to ./~ssh/id_rsa-<name>-keypair | |
chmod 700 ./~ssh/id_rsa-<name>-keypair | |
ec2-run-instances <instance-identifier, e.g.: ami-0d729464> -k <name>-keypair | |
# copy the value behind INSTANCE (should be smth. like i-64d4c00f) | |
ec2-describe-instances <copied value> (refresh until instance has booted) | |
# once it's running you will get an url which we use for ssh | |
ssh -i ~/.ssh/id_rsa-<name>-keypair root@<url> | |
sudo apt-get update | |
sudo apt-get install ruby-full build-essential | |
sudo apt-get install rubygems1.8 | |
sudo gem install right_aws |
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 "rubygems" | |
require "right_aws" | |
KEY = "xx" | |
SECRET = "xx" | |
SOURCE_BUCKET = "xx" | |
TARGET_BUCKET = "xx" | |
s3 = RightAws::S3.new(KEY, SECRET) | |
source = s3.bucket(SOURCE_BUCKET) | |
target = s3.bucket(TARGET_BUCKET, true) | |
source.keys.each{ |key| target.put(key.name, key.data) } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment