如何实现自动备份数据路里面所有业务表的功能:
#!/bin/bash echo "Dump mysql databases..." DB_USER=xxx DB_PASSWORD=xxx DB_LIST=$(echo "show databases;" | mysql -u${DB_USER} -p${DB_PASSWORD}) for db in ${DB_LIST} do if [ $db != "Database" ] && [ $db != "mysql" ] && [ $db != "phpmyadmin" ] && [ $db != "information_schema" ] && [ $db != "performance_schema" ]; then echo " backup "$db mysqldump -u${DB_USER} -p${DB_PASSWORD} $db > ./$db.sql fi done