daily pastebin goal
16%
SHARE
TWEET

Untitled

a guest Mar 19th, 2019 92 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2.  
  3.  
  4. MYSQL_USER=root
  5. MYSQL_PASS=123
  6. MYSQL_CONN="--user=${MYSQL_USER} --password=${MYSQL_PASS} "
  7.  
  8. DBLISTFILE=/tmp/databasestodump.txt
  9. SQL="SELECT schema_name FROM information_schema.schemata WHERE schema_name NOT IN ('mysql','information_schema','performance_schema')"
  10.  
  11. mysql ${MYSQL_CONN} -ANe"${SQL}" > ${DBLISTFILE}
  12.  
  13. dumpmemadafaka(){
  14.   local DB=$1
  15.   mysqldump --extended-insert=FALSE ${MYSQL_CONN}  $DB | gzip --best > $DB.sql.gz
  16. }
  17. // multithread
  18. for DB in `cat ${DBLISTFILE}` ;
  19. do
  20. dumpmemadafaka "$DB" &
  21. done
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top