From 65b27d772be32738a8508ea8e6c07f74f229cdb7 Mon Sep 17 00:00:00 2001 From: Mark Goddard Date: Wed, 23 Oct 2019 14:08:35 +0100 Subject: [PATCH] Fix mariabackup arguments After switching from innobackupex to mariabackup [1] for database backups, the kolla_mariadb_backup.sh script was not modified to account for the difference in arguments between innobackupex and mariabackup. There is a compatibility mode, the documentation [2] for which covers some of the differences. The following have been changed: - Add explicit --backup argument, now required - Remove './' positional argument - not required with --stream - Remove --no-timestamp argument - only supported in innobackupex compatibility mode - Remove --incremental argument - implied by --incremental-history-name - Remove deprecated --compress argument, which requires qpress to be installed (it is not). The stream is now passed through gzip instead [3] [1] https://mariadb.com/kb/en/library/mariabackup-overview/ [2] https://mariadb.com/kb/en/library/mariabackup-options/#-innobackupex [3] https://mariadb.com/kb/en/library/using-encryption-and-compression-tools-with-mariabackup/ Change-Id: I67cff47cbf56570b8eaeb66092dd87c2769fc8a6 Closes-Bug: #1843043 --- docker/mariadb/backup.sh | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/docker/mariadb/backup.sh b/docker/mariadb/backup.sh index 8c494a5ebf..a039d84e85 100644 --- a/docker/mariadb/backup.sh +++ b/docker/mariadb/backup.sh @@ -5,25 +5,24 @@ set -eu # Execute a full backup backup_full() { echo "Taking a full backup" - mariabackup --defaults-file=/etc/mysql/my.cnf \ - --no-timestamp \ + mariabackup \ + --defaults-file=/etc/mysql/my.cnf \ + --backup \ --stream=xbstream \ - --compress \ - --history=$(date +%d-%m-%Y) ./ > \ - $BACKUP_DIR/mysqlbackup-$(date +%d-%m-%Y-%s).qp.xbc.xbs + --history=$(date +%d-%m-%Y) | gzip > \ + $BACKUP_DIR/mysqlbackup-$(date +%d-%m-%Y-%s).qp.xbc.xbs.gz } # Execute an incremental backup backup_incremental() { echo "Taking an incremental backup" - mariabackup --defaults-file=/etc/mysql/my.cnf \ - --no-timestamp \ + mariabackup \ + --defaults-file=/etc/mysql/my.cnf \ + --backup \ --stream=xbstream \ - --compress \ - --incremental \ --incremental-history-name=$(date +%d-%m-%Y) \ - --history=$(date +%d-%m-%Y) ./ > \ - $BACKUP_DIR/incremental-$(date +%H)-mysqlbackup-$(date +%d-%m-%Y-%s).qp.xbc.xbs + --history=$(date +%d-%m-%Y) | gzip > \ + $BACKUP_DIR/incremental-$(date +%H)-mysqlbackup-$(date +%d-%m-%Y-%s).qp.xbc.xbs.gz } BACKUP_DIR=/backup/