I have a S3 bucket, the folder structure looks like this:bucket_name/year/month/day
, for each day, there are a couple of files in the corresponding folder.
For example, I have 10 files in bucket_name/2021/09/05
and bucket_name/2021/09/04
, 10 files in bucket_name/2021/09/06
(current day is 2021/09/06
), how can I tell the code to look for files in the historical folders (except bucket_name/2021/09/06
) and delete them?
how can I add a step to look for the previous folders, hope this makes sense, thanks.