Bird
0
0

You want to download all files from an S3 bucket folder backups/ to your local backup_local/ folder, but only files modified in the last 7 days. Which approach is best?

hard📝 Application Q9 of 15
AWS - S3 Fundamentals
You want to download all files from an S3 bucket folder backups/ to your local backup_local/ folder, but only files modified in the last 7 days. Which approach is best?
AUse 'aws s3 sync s3://mybucket/backups/ backup_local/ --exact-timestamps' and filter by date manually
BUse 'aws s3 cp s3://mybucket/backups/ backup_local/ --recursive' and then delete old files locally
CUse 'aws s3 rm' to remove old files before downloading
DUse 'aws s3api list-objects' with date filter, then download files individually
Step-by-Step Solution
Solution:
  1. Step 1: Understand filtering by modification date

    'aws s3 sync' and 'cp' do not support date filters directly.
  2. Step 2: Use 'aws s3api list-objects' to filter by date

    Listing objects with date filter allows selecting files modified in last 7 days, then download individually.
  3. Step 3: Eliminate other options

    Manual filtering or deleting is inefficient; 'rm' deletes files, not relevant here.
  4. Final Answer:

    Use 'aws s3api list-objects' with date filter, then download files individually -> Option D
  5. Quick Check:

    Date filtering requires list-objects + manual download [OK]
Quick Trick: Filter by date using list-objects, then download files [OK]
Common Mistakes:
MISTAKES
  • Expecting sync or cp to filter by date
  • Deleting files before download
  • Manual filtering after full download

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes