Skip to content

Commit cf99cb9

Browse files
authored
Merge pull request #52 from abunchofhacks/events
Added CONFIG_mysql_dump_create_event to allow backups with fewer privileges if events are not used
2 parents 46bc98f + b70486b commit cf99cb9

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
@@ -84,6 +84,7 @@ load_default_config() {
8484
CONFIG_mysql_dump_socket=''
8585
CONFIG_mysql_dump_create_database='no'
8686
CONFIG_mysql_dump_add_drop_database='no'
87+
CONFIG_mysql_dump_create_event='yes'
8788
CONFIG_mysql_dump_use_separate_dirs='yes'
8889
CONFIG_mysql_dump_compression='gzip'
8990
CONFIG_mysql_dump_commcomp='no'
@@ -516,7 +517,7 @@ backup_local_files () {
516517
# @deps: load_default_config
517518
parse_configuration () {
518519
# OPT string for use with mysqldump ( see man mysqldump )
519-
opt=( '--quote-names' '--opt' '--events' )
520+
opt=( '--quote-names' '--opt' )
520521

521522
# OPT string for use with mysql (see man mysql )
522523
mysql_opt=()
@@ -584,6 +585,10 @@ parse_configuration () {
584585
opt=( "${opt[@]}" '--add-drop-database' )
585586
fi
586587

588+
if [[ "${CONFIG_mysql_dump_create_event}" = "yes" ]]; then
589+
opt=( "${opt[@]}" '--events' )
590+
fi
591+
587592
# if differential backup is active and the specified rotation is smaller than 21 days, set it to 21 days to ensure, that
588593
# master backups aren't deleted.
589594
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)