Created
May 15, 2018 16:00
-
-
Save nhp/25095df24a614450c7ad99e8bafbee16 to your computer and use it in GitHub Desktop.
get latest file from given s3-bucket. Call it with ./s3-latest buckename foldername
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
KEY=`aws s3 ls s3://$1/$2 --recursive | sort | tail -n 1 | awk '{print $4}'` | |
aws s3 cp s3://$1/$KEY ./$(basename $KEY) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment