Created
September 13, 2011 06:20
-
-
Save papettoTV/1213245 to your computer and use it in GitHub Desktop.
DBデータ(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 | |
youbi=`date +%w` | |
dmpfile="db_"${youbi}".dmp.gz" | |
mysqldump -u user -ppassword --databases databasename | gzip > ${dmpfile} | |
exec ssh-agent scp ${dmpfile}.gz user@backup_server:/backup/dir/path & |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment