Pages

Showing posts with label Amazon. Show all posts
Showing posts with label Amazon. Show all posts

Thursday, February 18, 2016

Best way to move files between S3 buckets - Different S3 Accounts

Here is a ruby class for performing this: https://gist.github.com/4080793

$ gem install aws-sdk
$ irb -r ./bucket_sync_service.rb
> from_creds = {aws_access_key_id:"XXX",
                aws_secret_access_key:"YYY",
                bucket:"first-bucket"}
> to_creds = {aws_access_key_id:"ZZZ",
              aws_secret_access_key:"AAA",
              bucket:"first-bucket"}
> syncer = BucketSyncService.new(from_creds, to_creds)
> syncer.debug = true # log each object
> syncer.perform
This will copy complete bucket content to new bucket.

Thursday, May 15, 2014

Copy a file from your system to EC2 Server with port and pem file



Here is command for Copying a file from your system to EC2 Server with port and pem file:

scp -P <PORT> -i xyz.pem  /home/user/file.txt  ec2-user@host:/home/ec2-user/

Below are the all available options that you can use based on your requirements:

scp [-12346BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file] [-l limit] [-o ssh_option] [-P port] [-S program] [[user@]host1:]file1 ... [[user@]host2:]file2