Member-only story
How to download an entire S3 bucket
May 5, 2022
Perhaps the easiest way to do it is with aws cli.
- install awscli:
(linux)curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
(mac)
https://awscli.amazonaws.com/AWSCLIV2.pk
(windows)
https://awscli.amazonaws.com/AWSCLIV2.msi - Syncronize S3 bucket to a local folder:
aws s3 sync s3://<your_bucket> <your_local_folder>
An example. You have got a bunch of content in a bucket named mybucket. You would like to download the content of mybucket into backup_mybucket folder.
aws s3 sync s3://mycket backup_mybucket
— —
In order to copy specific “folder” in the bucket, it is possible to do that with the cp command. Lets say, our mybucket bucket contains an importantfolder folder and we want to copy the contents of this folder, recursively, into our local folder copy_important_folder. The command for this would be:
aws s3 cp s3://mybucket/importantfolder copy_important_folder --recursive