Package: automysqlbackup
Version: 2.6+debian.4-1
Severity: wishlist
Tags: patch

Hi folks,

The original script support the configuration of the day of the month (also 00
to disable it).
I need this to "disable" the monthly backup (which takes too much disk
space)...

I also need a mysqldump option "--single-transaction" to avoid the DB lock (our
DB is 22GB and
takes 15 minutes to backup, and we cannot lock the DB that long).

The fix is trivial, simple add a new DOMONTHLY=xx and OPTIONS="xx" in
/etc/default/automysqlbackup and
change a bit /usr/sbin/automysqlbackup



-- System Information:
Debian Release: 8.0
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.16.0-4-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)

Versions of packages automysqlbackup depends on:
ii  bsd-mailx [mailx]                        8.1.2-0.20111106cvs-1
ii  mysql-client                             5.5.42-1
ii  mysql-client-5.5 [virtual-mysql-client]  5.5.42-1

Versions of packages automysqlbackup recommends:
ii  mutt  1.5.23-3

automysqlbackup suggests no packages.
--- /usr/sbin/automysqlbackup	2014-07-23 10:21:08.000000000 +0200
+++ automysqlbackup	2016-01-25 10:02:10.434759681 +0100
@@ -76,6 +76,10 @@
 # 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
 
@@ -100,6 +104,9 @@
 # Backup of stored procedures and routines
 ROUTINES=yes
 
+# Mysqldump additional option (like "--single-transaction")
+OPTIONS=""
+
 fi
 
 #=====================================================================
@@ -427,7 +434,7 @@
 	if [ $1 = "information_schema" ] ; then
 		NEWOPT="--skip-opt ${OPT}"
 	else
-		NEWOPT="--opt $OPT"
+		NEWOPT="--opt $OPT $OPTIONS"
 	fi
 
 	if [ -z "${USERNAME}" -o -z "${PASSWORD}" ] ; then
@@ -523,7 +530,7 @@
 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
  
@@ -596,7 +603,7 @@
 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"
 			compression "$BACKUPDIR/monthly/$DATE.$M.all-databases.sql"

Reply via email to