Skip to content

About

General purpose scripts to do different actions

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

Β 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“¦ 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 πŸ”„

About

General purpose scripts to do different actions

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages