#! /bin/sh ssh dev.monserveur.com 'mysql --skip-column-names -umonadmin -pmonmotdepasse -e "show databases WHERE `Database` LIKE \"%mesbases%\"" | while read dbname; do mysqldump --lock-all-tables -umyadmin -pmy2166 "$dbname" | gzip> /tmp/"$dbname".sql.gz; done'
#! /bin/sh faire(){ echo $1 ssh dev.monserveur.com 'mysql --skip-column-names -umonadmin -pmonmotdepasse '$1' -e "show tables" | while read table_name; do mysqldump --lock-all-tables -umonadmin -pmonmotdepasse '$1' "$table_name" | gzip> /tmp/"$table_name".sql.gz; done' } faire "mabase"
#! /bin/sh faire(){ echo "\n faire : " $1 $2 mysqldump -h dev.monserveur.com -umonadmin -pmonmotdepasse --lock-tables=false $1 $2 | mysql -usauv -psauv $1 echo "\n fini \n" } #******************************************************************* base="mabase" faire $base banque faire $base client faire $base produit base="mabase2" faire $base tarif