Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local="$HOME/workspace/data"
- remote=rails@10.212.148.20
- for info in 'cpl_enterprise_demo:labis:Lm0d@t@M7'
- do
- db=$(echo $info | cut -d: -f1)
- user=$(echo $info | cut -d: -f2)
- pw=$(echo $info | cut -d: -f3)
- file=$remote.$db.sql.gz
- fileuz=$remote.$db.sql
- echo "ssh $remote \"mysqldump -h 10.212.148.12 --user=$user --password='$pw' $db | gzip > ~/$remote.$db.sql.gz\""
- echo "scp $remote:~/$remote.$db.sql.gz $local"
- echo "mysqladmin --user=rails --password=railsrails --force drop labis_development"
- echo "mysqladmin --user=rails --password=railsrails --force create labis_development"
- echo "gunzip $local/$file"
- echo "cat $local/$fileuz | mysql -u root labis_development"
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement