From bc8a8562dcab511906497a074133bad2736a43e9 Mon Sep 17 00:00:00 2001 From: Sander in 't Veld Date: Tue, 15 Jun 2021 16:06:42 +0200 Subject: [PATCH] Added CONFIG_mysql_dump_tablespaces (default 'yes'), which adds mysqldump option '--no-tablespaces' if set to 'no'; otherwise the user requires PROCESS privileges. --- automysqlbackup | 5 +++++ automysqlbackup.conf | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/automysqlbackup b/automysqlbackup index 02ca79e..f1b6795 100755 --- a/automysqlbackup +++ b/automysqlbackup @@ -93,6 +93,7 @@ load_default_config() { CONFIG_mysql_dump_master_data= CONFIG_mysql_dump_full_schema='yes' CONFIG_mysql_dump_dbstatus='yes' + CONFIG_mysql_dump_tablespaces='yes' CONFIG_mysql_dump_differential='no' CONFIG_mysql_dump_login_path='automysqldump' CONFIG_mysql_dump_login_path_file='' @@ -560,6 +561,10 @@ parse_configuration () { opt=( "${opt[@]}" '--add-drop-database' ) fi + if [[ "${CONFIG_mysql_dump_tablespaces}" = "no" ]]; then + opt=( "${opt[@]}" '--no-tablespaces' ) + fi + # if differential backup is active and the specified rotation is smaller than 21 days, set it to 21 days to ensure, that # master backups aren't deleted. if [[ "x$CONFIG_mysql_dump_differential" = "xyes" ]] && (( ${CONFIG_rotation_daily} < 21 )); then diff --git a/automysqlbackup.conf b/automysqlbackup.conf index fc72be0..6152480 100644 --- a/automysqlbackup.conf +++ b/automysqlbackup.conf @@ -190,6 +190,11 @@ CONFIG_db_exclude_pattern=() # in the meantime. #CONFIG_mysql_dump_dbstatus='yes' +# Include tablespace information in backup? +# As a breaking change in MySQL 5.7.31 and 8.0.21, mysqldump requires either +# PROCESS privileges or must be invoked with the --no-tablespaces option. +#CONFIG_mysql_dump_tablespaces='yes' + # Backup dump settings # Include CREATE DATABASE in backup?