Skip to content

Commit b70486b

Browse files
committed
Added CONFIG_mysql_dump_create_event (default 'yes'), which toggles mysql option '--events', to allow backups without EVENT privileges.
1 parent 7c32e42 commit b70486b

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

automysqlbackup

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ load_default_config() {
8383
CONFIG_mysql_dump_socket=''
8484
CONFIG_mysql_dump_create_database='no'
8585
CONFIG_mysql_dump_add_drop_database='no'
86+
CONFIG_mysql_dump_create_event='yes'
8687
CONFIG_mysql_dump_use_separate_dirs='yes'
8788
CONFIG_mysql_dump_compression='gzip'
8889
CONFIG_mysql_dump_commcomp='no'
@@ -492,7 +493,7 @@ backup_local_files () {
492493
# @deps: load_default_config
493494
parse_configuration () {
494495
# OPT string for use with mysqldump ( see man mysqldump )
495-
opt=( '--quote-names' '--opt' '--events' )
496+
opt=( '--quote-names' '--opt' )
496497

497498
# OPT string for use with mysql (see man mysql )
498499
mysql_opt=()
@@ -560,6 +561,10 @@ parse_configuration () {
560561
opt=( "${opt[@]}" '--add-drop-database' )
561562
fi
562563

564+
if [[ "${CONFIG_mysql_dump_create_event}" = "yes" ]]; then
565+
opt=( "${opt[@]}" '--events' )
566+
fi
567+
563568
# if differential backup is active and the specified rotation is smaller than 21 days, set it to 21 days to ensure, that
564569
# master backups aren't deleted.
565570
if [[ "x$CONFIG_mysql_dump_differential" = "xyes" ]] && (( ${CONFIG_rotation_daily} < 21 )); then

automysqlbackup.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,9 @@ CONFIG_db_exclude_pattern=()
192192

193193
# Backup dump settings
194194

195+
# Include CREATE EVENT in backup?
196+
#CONFIG_mysql_dump_create_event='yes'
197+
195198
# Include CREATE DATABASE in backup?
196199
#CONFIG_mysql_dump_create_database='no'
197200

0 commit comments

Comments
 (0)