s3- boto- list files within a bucket by upload time

假如想象 提交于 2019-12-01 18:35:22

How big is the list? You could sort the list on the 'last_modified' attr of the Key

orderedList = sorted(bucketList, key=lambda k: k.last_modified)
keysYouWant = orderedList[0:100]

If your list is HUGE this may not be efficient. Check out the inline docs for the list() function in boto.s3.bucket.Bucket.

My reading of List Objects operation documentation, suggests that objects are always listed in alphabetical order (by object key).

If you encode the creation time of each object into the object key, you may be able to achieve what you want.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!