Last active
March 31, 2016 06:44
-
-
Save MacoTasu/cf281d304b805c653cd02a2129a35128 to your computer and use it in GitHub Desktop.
mysqlをdumpしてs3にアップロードするshell
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 | |
mysqldump -h $MYSQL_HOST -u$MYSQL_USER_NAME -p$MYSQL_PASSWORD --single-transaction --master-data=2 $DB_NAME | gzip > mysqldump.sql.gz | |
date_str=`date +"%Y%m%d%I%M"` | |
aws s3 mv mysqldump.sql.gz s3://****-mysqldump/"${date_str}".sql.gz |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment