Description: Support DOMONTHLY=xx and a new OPTIONS="xx" configurations
Author: Stephan Bodmer <sbodmer@lsi-media.ch>
Bug-Debian: https://bugs.debian.org/812578
Forwarded: no
Last-Update: 2020-07-27

--- automysqlbackup-2.6+debian.4.orig/automysqlbackup
+++ automysqlbackup-2.6+debian.4/automysqlbackup
@@ -76,6 +76,10 @@ SEPDIR=yes
 # Which day do you want weekly backups? (1 to 7 where 1 is Monday)
 DOWEEKLY=6
 
+# Which day of the month to execute the monthly backup (00 = no monthly backup)
+# Two digit required
+DOMONTHLY=01
+
 # Choose Compression type. (gzip or bzip2)
 COMP=gzip
 
@@ -103,6 +107,9 @@ SOCKET=
 # Backup of stored procedures and routines
 ROUTINES=yes
 
+# Mysqldump additional option (like "--single-transaction")
+OPTIONS=""
+
 fi
 
 #=====================================================================
@@ -430,7 +437,7 @@ dbdump () {
 	if [ "$1" = "information_schema" ] ; then
 		NEWOPT="--skip-opt ${OPT}"
 	else
-		NEWOPT="--opt $OPT"
+		NEWOPT="--opt $OPT $OPTIONS"
 	fi
 
 	if [ "$COMPDIRECT" = "yes" ] && ( [ "$COMP" = "gzip" ] || [ "$COMP" = "bzip2" ] ); then
@@ -551,7 +558,7 @@ if [ "$SEPDIR" = "yes" ]; then
 echo Backup Start Time `date`
 echo ======================================================================
 	# Monthly Full Backup of all Databases
-	if [ "$DOM" = "01" ]; then
+	if [ "$DOM" = "$DOMONTHLY" ]; then
 		for MDB in $MDBNAMES
 		do
  
@@ -621,7 +628,7 @@ else # One backup file for all DBs
 echo Backup Start `date`
 echo ======================================================================
 	# Monthly Full Backup of all Databases
-	if [ "$DOM" = "01" ]; then
+	if [ "$DOM" = "$DOMONTHLY" ]; then
 		echo Monthly full Backup of \( $MDBNAMES \)...
 			dbdump "$MDBNAMES" "$BACKUPDIR/monthly/$DATE.$M.all-databases.sql"
 			BACKUPFILES="$BACKUPFILES $BACKUPDIR/monthly/$DATE.$M.all-databases.sql$SUFFIX"
