A simple Go utility to download all files from an AWS S3 bucket to a local storage
folder, preserving the directory structure.
- Downloads all objects from an S3 bucket (handles pagination)
- Saves files locally in the
storage
directory - Preserves S3 folder structure
- Set up AWS credentials (via environment variables or config file).
- Build and run:
go run . 2>&1 | tee output.txt
Create a .env file based on the example provided:
-
Copy the example file to create a new .env:
cp .env.example .env
-
Open the newly created
.env
file and fill in the necessary values.
These environment variables are required for authenticating with AWS and downloading files from your S3 bucket.
- Go 1.18+
- AWS credentials with S3 read access
MIT