Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I copy clone/duplicate a folder on S3?

I want to make a copy of the folders and images on my s3 bucket for my development server. How can I do that?

like image 966
Trip Avatar asked Aug 04 '10 20:08

Trip


People also ask

How does S3 handle duplicate files?

S3 supports versioning. This means that when you upload to the same key twice, two versions of the file are stored. Note that if you upload the exact same file twice, you get to pay for two identical copies of the same file on S3.

What is the command to copy files recursively in a folder to an S3 bucket?

s3://destination --recursive . That way, it is copying the contents of the current directory.

Why can't I copy an object between two Amazon S3 buckets?

To copy an object between buckets, you must make sure that the correct permissions are configured. To copy an object between buckets in the same AWS account, you can set permissions using IAM policies.


2 Answers

I just wanted to write an updated answer here:

You can now use Amazon's AWS Management Console (under the S3 tab) to right click on any folder (or file) in Bucket A, click Copy, then navigate to Bucket B and right click and click Paste

This makes it extremely easy to copy the contents of your production bucket over to your dev bucket.

like image 73
iwasrobbed Avatar answered Sep 18 '22 22:09

iwasrobbed


If you are using linux, and just want to drag copies down to the local filesystem, then you could use s3sync:

http://www.s3sync.net/wiki

If you wanted to access the files directly on s3, you could mount s3 as a fuse filesystem locally, but beware that accessing files using this method is dependent on your connection, so there could be speed issues. I've used s3fs perfectly well for accessing backups etc:

(can only post one link atm, but google s3fs - it's hosted on googlecode)

If you just need a copy, then s3sync is the easiest option.

Hope this helps.

like image 39
Robbie Scourou Avatar answered Sep 22 '22 22:09

Robbie Scourou