Created
April 24, 2015 06:46
-
-
Save liaol/202b2b497ad5d0d0d232 to your computer and use it in GitHub Desktop.
backup mysql daily
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/bash | |
database="" | |
user="" | |
password="" | |
filename="$database-`date +'%Y%m%d'`" | |
dir=/root/mysqlbak/$database | |
/usr/bin/mysqldump --opt $database -u$user -p$password > $dir/$filename.sql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment