π¦ README: Bulk and Time-Range File Download from S3
π Introduction
This guide explains how to use two powerful AWS CLI scripts for downloading files from Amazon S3: a bulk file download script for downloading entire datasets and a time-range download script for retrieving files modified within a specific time window. These scripts simplify S3 file management and save time! β³
β¨ Features
π Bulk File Download Script
ποΈ Download all files from an S3 bucket or a specific folder.
π― Supports wildcard patterns for selective downloads.
π οΈ Automatically handles folder structures.
β±οΈ Time-Range Download Script
π
Download files modified within a specific date and time range.
β° Filters files using ISO 8601 format (e.g., YYYY-MM-DDTHH:mm:ssZ).
π‘οΈ Skips invalid or empty keys to avoid errors.
β
Prerequisites
Install and Configure AWS CLI βοΈ:
Download and install the AWS CLI from the official AWS website. Run aws configure to set up your credentials and default region. Ensure Permissions π:
IAM user or role must have: s3:ListBucket π s3:GetObject π₯ Windows Batch File Support π₯οΈ:
These scripts are designed for Windows. Open Command Prompt (cmd.exe) to execute.
π How to Use the Scripts
π 1. Bulk File Download Script
π― Purpose:
Download all files from an S3 bucket or a specific folder. Use this script for backups or fetching a complete dataset.
π οΈ Usage:
Save the script as bulk_download_s3.bat.
Open Command Prompt.
Run the script and follow the prompts.
π Example Prompts:
Enter the S3 bucket name (without s3://): my-bucket
Enter the S3 folder path (leave empty for root): data/
Enter the filename pattern (e.g., _.txt, . for all files): _.csv
Enter the local download directory: C:\S3Downloads
π Features:
Specify a wildcard pattern (e.g., *.csv) to download only specific file types.
Automatically creates the local directory if it doesnβt exist. π
β±οΈ 2. Time-Range Download Script
π― Purpose:
Download files from an S3 bucket modified within a specific date and time range. Ideal for syncing recent changes. π
π οΈ Usage:
Save the script as timerange_download_s3.bat.
Open Command Prompt.
Run the script and follow the prompts.
π Example Prompts:
Enter the S3 bucket name (without s3://): my-bucket
Enter the folder path in the S3 bucket (leave empty for root): logs/
Enter the start date and time (YYYY-MM-DDTHH:mm:ssZ, e.g., 2024-12-10T08:00:00Z): 2024-12-10T00:00:00Z
Enter the end date and time (YYYY-MM-DDTHH:mm:ssZ, e.g., 2024-12-10T18:00:00Z): 2024-12-10T23:59:59Z
Enter the local download directory: C:\FilteredLogs
Keywords for Search Optimization
AWS CLI S3 file download π
Bulk S3 file download script π
S3 time-range file download β±οΈ
Automate S3 downloads with AWS CLI π οΈ
Download files by modification date S3 π°οΈ
AWS S3 CLI scripts for file management π