Created
January 8, 2011 13:54
-
-
Save ikbear/770856 to your computer and use it in GitHub Desktop.
简单的备份mysql数据库的脚本,完全自用,需要的可以参考一下,但绝不能照搬
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
suffix=$(date +%y%m%d) | |
password="pass" | |
user="user" | |
mkdir db | |
cd db | |
mysqldump -u$user -p$password blog > blog.$suffix.sql | |
mysqldump -u$user -p$password en > en.$suffix.sql | |
cd .. | |
tar -cf db.$suffix.tar.gz db | |
rm -rf db |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment