Skip to content

Commit

Permalink
Merge branch 'release/2.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Daisuke Baba committed Feb 10, 2017
2 parents b94b39b + e9a1997 commit 3385c39
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ When providing `DAILY_CLEANUP=1`, the following scheduled cleaner is enabled (di
`MAX_DAILY_BACKUP_FILES` is used for specifying the max number of the backup files to be retained.

# Revision History
- 2.1.0
* Add `--add-drop-database` to mysqldump

- 2.0.0
* Add backup cleaner (disabled by default)

Expand Down
4 changes: 2 additions & 2 deletions backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ TS=$(date +%Y-%m-%d-%H%M%S)
if [ -z "$DBS" ]
then
# Backup all DB's in bulk
mysqldump -uroot -p$MYSQL_ROOT_PASSWORD -h$MYSQL_HOST --all-databases $MYSQLDUMP_OPTIONS | gzip > $DIR/${PREFIX}all-databases-$TS.sql.gz
mysqldump -uroot -p$MYSQL_ROOT_PASSWORD -h$MYSQL_HOST --add-drop-database --all-databases $MYSQLDUMP_OPTIONS | gzip > $DIR/${PREFIX}all-databases-$TS.sql.gz
else
# Backup each DB separately
for DB in $DBS
do
mysqldump -uroot -p$MYSQL_ROOT_PASSWORD -h$MYSQL_HOST -B $DB $MYSQLDUMP_OPTIONS | gzip > $DIR/$PREFIX$DB-$TS.sql.gz
mysqldump -uroot -p$MYSQL_ROOT_PASSWORD -h$MYSQL_HOST --add-drop-database -B $DB $MYSQLDUMP_OPTIONS | gzip > $DIR/$PREFIX$DB-$TS.sql.gz
done
fi

Expand Down

0 comments on commit 3385c39

Please sign in to comment.