Advertisement
Guest User

Untitled

a guest
Sep 6th, 2017
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. #!/bin/sh
  2. # copy the database source files to destination
  3.  
  4. dbname='palus'
  5. source='/DATA/4GLV/tokudb/'
  6.  
  7. destip='192.168.150.137'
  8. destuser='db'
  9. destpass='db'
  10. destport='3306'
  11.  
  12. destination="root@$destip:/mnt/data2/"
  13.  
  14. time mysqldump --databases $dbname --no-data | mysql -h$destip -u$destuser -p$destpass -P$destport
  15. if [[ $? -eq 0 ]];then
  16.  
  17. mysql -Bse"SELECT CONCAT(' scp $source ', SUBSTR(internal_file_name, 3, 255), ' $destination ') FROM information_schema.TokuDB_file_map WHERE \`database\` = \"$dbname\"" > to_move.txt
  18.  
  19. fi
  20.  
  21. exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement