- #!/bin/sh
- #program:
- # backup the mysql
- #history:
- #2013/08/17 yubinhong first release
- read -p "请输入要备份数据库的个数:" n
- for i in $(seq 1 $n)
- do
- read -p "请输入第$i个数据库:" database
- time=$(date +%Y%m%d)
- mysqldump -uroot -p123456 $database > $database$time.sql
- done
- echo "备份完成!"
- #该片段来自于http://www.codesnippet.cn/detail/190820135201.html
来源: http://www.codesnippet.cn/detail/190820135201.html