mysql_bak.sh

mkdir /adsend/bak/mysql/`date +%Y%m%d`

mysqldump -u root empirecms>/adsend/bak/mysql/`date +%Y%m%d`/empirecms.`date +%Y%m%d`

tar -zcvf /adsend/bak/mysql/`date +%Y%m%d`.tar /adsend/bak/mysql/`date +%Y%m%d`/ --remove-files

mysqldump -u root --all-databases>/adsend/bak/mysql/all_`date +%Y%m%d`.sql


你可能感兴趣的:(mysql_bak.sh)