Last active
January 29, 2017 06:11
-
-
Save tily/db903af2e7be213ba89ec44b2a045e5c to your computer and use it in GitHub Desktop.
restore.sh
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
[codesuki/ecs-nginx-proxy: Reverse proxy for AWS ECS. Lets you address your docker containers by sub domain.](https://github.com/codesuki/ecs-nginx-proxy) |
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
dirs=$(s3cmd ls s3://tily-heroku-backup | grep DIR | awk '{print $2}') | |
for dir in $dirs; do | |
source=$(s3cmd ls $dir | tail -1 | awk '{print $4}') | |
echo $source | |
dbname=$(echo $source | awk -F '/' '{print $4}') | |
mkdir -p $dbname | |
target=$dbname/`basename $source` | |
echo $source $target | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment