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
This commit is contained in:
Mark Goddard 2019-10-23 14:08:35 +01:00
parent e239169e13
commit 65b27d772b
1 changed files with 10 additions and 11 deletions

View File

@ -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/