Back

Explore Courses Blog Tutorials Interview Questions
0 votes
1 view
in AWS by (19.1k points)

I noticed that there doesn't seem to be an option to download an entire S3 bucket from the AWS Management Console.

Is there an easy way to grab everything in one of my buckets? I was thinking about making the root folder public, using wget to grab it all, and then making it private again but I don't know if there's an easier way.

1 Answer

0 votes
by (44.3k points)

Using AWS CLI

Install AWS CLI: Installing AWS CLI documentation

After installation, run this:

Command:

aws s3 sync s3://your_bucket_name .

Output:

download: s3://your_bucket_name/test.txt to test.txt

download: s3://your_bucket_name/test2.txt to test2.txt

One-way sync - This can be used to download all of your files. No existing files will be deleted in your current directory. Unless you specify the --delete tag, there won’t be any change in your S3 bucket.

You can also do S3 bucket to S3 bucket, or local to S3 bucket sync.

Check out this documentation for more insights:

http://docs.aws.amazon.com/cli/latest/reference/s3/sync.html

How to download a folder from a bucket:

The above example downloads a complete bucket, but if you only want a particular folder use this:

aws s3 cp s3://your_bucket_name/PATH/TO/FOLDER local_folder_name --recursive

All files and folder keys in that /PATH/TO/FOLDER directory inside the Bucket will be downloaded recursively until everything is download.

Related questions

Want to get 50% Hike on your Salary?

Learn how we helped 50,000+ professionals like you !

0 votes
1 answer
0 votes
1 answer
Welcome to Intellipaat Community. Get your technical queries answered by top developers!

28.4k questions

29.7k answers

500 comments

94.2k users

Browse Categories

...