Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 14185

List objects in S3 bucket with timestamp filter

$
0
0

Background

Is there a way to get a list of all the files on a s3 bucket that are newer than a specific timestamp. For example i am trying to figure out and get a list of all the files that got modified yesterday afternoon.

In particular i have bucket called foo-bar and inside that i have a folder called prod where the files i am trying to parse through lie.

What I am trying so far

I referred to boto3 documentation and came up with the following so far.

from boto3 import clientconn = client('s3')conn.list_objects(Bucket='foo-bar', Prefix='prod/')['Contents']

Issues

There is two issues with this solution, the first one is it is only listing 1000 files even though i have over 10,000 files and the other is i am not sure how i filter for time?


Viewing all articles
Browse latest Browse all 14185

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>