Boto3 – Recursively copy files from one folder to another folder in S3

Question:

I’m my S3 bucket there are so many files are in different file formats. So I would like to copy from all the subfolders which has .JSON extension to another folder.

Current Structure:

It (JSON FILES) should be copied to the folder arrange:

I tried this (But there is not filter for JSON) From stackoverflow

Answer:

You can keep a filter for JSON files like below :

Leave a Reply