Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #Export MySQL data from AWS using SSH
- #Create a databases.txt file with one line per database. Can be done by piping out "show databases" command
- #TODO fix the gzip error; till then use mysql-dump-from-rds-command-creator
- SSH-USER=ubuntu
- SSH-SERVER=123.123.123.123
- SSH-KEYFILE=server.pem
- DB-SERVER=mysql.czpoly.1.east.amazonaws.com
- DB-USER=admin
- DB-PASS=admin
- while read d; do
- echo ssh -i \"$SSH-KEYFILE\" $SSH-USER@$SSH-SERVER \"mysqldump -u$DB-USER -p$DB-PASS -h$DB-SERVER $d | gzip -9\" | gzip -d > $d.sql
- done <databases.txt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement