Advertisement
Guest User

Untitled

a guest
Jan 30th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. local="$HOME/workspace/data"
  2. remote=rails@10.212.148.20
  3.  
  4. for info in 'cpl_enterprise_demo:labis:Lm0d@t@M7'
  5. do
  6. db=$(echo $info | cut -d: -f1)
  7. user=$(echo $info | cut -d: -f2)
  8. pw=$(echo $info | cut -d: -f3)
  9. file=$remote.$db.sql.gz
  10. fileuz=$remote.$db.sql
  11. echo "ssh $remote \"mysqldump -h 10.212.148.12 --user=$user --password='$pw' $db | gzip > ~/$remote.$db.sql.gz\""
  12. echo "scp $remote:~/$remote.$db.sql.gz $local"
  13. echo "mysqladmin --user=rails --password=railsrails --force drop labis_development"
  14. echo "mysqladmin --user=rails --password=railsrails --force create labis_development"
  15. echo "gunzip $local/$file"
  16. echo "cat $local/$fileuz | mysql -u root labis_development"
  17. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement