标签:name 备份 ash zip from mysqld tables ant database
#!/bin/bashfor db_name in mysql -e "show databases"|sed ‘1,2d‘
;do #取库名
for table_name in mysql -e "show tables from $db_name;"|sed ‘1d‘
;do #取表名
mkdir -p /bash_shell/test_file/$(date +%F)/$db_name
/usr/bin/mysqldump --lock-tables=0 ${db_name} $table_name|gzip >/bash_shell/test_file/$(date +%F)/$db_name/${dbname}${tablename}$(date +%F).sql.gz
done
done
标签:name 备份 ash zip from mysqld tables ant database
原文地址:https://blog.51cto.com/9625010/2417725