Reputation: 3
I am trying to fetch all files between two given dates using the S3 API called s3ap but I am not getting correct syntax for the same.
When I tried for all files after a given date I am able to do that by using below mentioned command:
aws s3api list-objects --profile flashtalking --bucket bucket-name --query "Contents[?LastModified >= '$last_modificaion_date']"
Upvotes: 0
Views: 1742
Reputation: 43
I modified the above query slightly and I was able to get it working.
Hope this helps!
ubuntu@ip-172-31-19-128:~$ aws s3api list-objects --bucket s3-knowledge-base --query 'Contents[?LastModified>=`2019-05-21T14:38:07.000Z`].{Key : Key, LastModified: LastModified }'
[
{
"Key": "images/tnats/connectivity.JPG",
"LastModified": "2019-05-21T14:38:07.000Z"
},
{
"Key": "images/tnats/gsk-logo.png",
"LastModified": "2019-05-29T16:58:46.000Z"
}
]
Upvotes: 1