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


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


You can keep a filter for JSON files like below :

Leave a Reply