diff --git a/automysqlbackup b/automysqlbackup index 02ca79e..2a3ee34 100755 --- a/automysqlbackup +++ b/automysqlbackup @@ -83,6 +83,7 @@ load_default_config() { CONFIG_mysql_dump_socket='' CONFIG_mysql_dump_create_database='no' CONFIG_mysql_dump_add_drop_database='no' + CONFIG_mysql_dump_create_event='yes' CONFIG_mysql_dump_use_separate_dirs='yes' CONFIG_mysql_dump_compression='gzip' CONFIG_mysql_dump_commcomp='no' @@ -492,7 +493,7 @@ backup_local_files () { # @deps: load_default_config parse_configuration () { # OPT string for use with mysqldump ( see man mysqldump ) - opt=( '--quote-names' '--opt' '--events' ) + opt=( '--quote-names' '--opt' ) # OPT string for use with mysql (see man mysql ) mysql_opt=() @@ -560,6 +561,10 @@ parse_configuration () { opt=( "${opt[@]}" '--add-drop-database' ) fi + if [[ "${CONFIG_mysql_dump_create_event}" = "yes" ]]; then + opt=( "${opt[@]}" '--events' ) + 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..34fcf92 100644 --- a/automysqlbackup.conf +++ b/automysqlbackup.conf @@ -192,6 +192,9 @@ CONFIG_db_exclude_pattern=() # Backup dump settings +# Include CREATE EVENT in backup? +#CONFIG_mysql_dump_create_event='yes' + # Include CREATE DATABASE in backup? #CONFIG_mysql_dump_create_database='no'