Advertisement
Guest User

Untitled

a guest
Oct 13th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. #!/bin/bash
  2. #Export MySQL data from AWS using SSH
  3. #Create a databases.txt file with one line per database. Can be done by piping out "show databases" command
  4. #TODO fix the gzip error; till then use mysql-dump-from-rds-command-creator
  5. SSH-USER=ubuntu
  6. SSH-SERVER=123.123.123.123
  7. SSH-KEYFILE=server.pem
  8. DB-SERVER=mysql.czpoly.1.east.amazonaws.com
  9. DB-USER=admin
  10. DB-PASS=admin
  11. while read d; do
  12. 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
  13. done <databases.txt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement