[-]
[+]
|
Changed |
automysqlbackup.spec
|
|
[-]
[+]
|
Changed |
automysqlbackup-2.6.6.sh
^
|
@@ -275,6 +275,8 @@
#=====================================================================
# Change Log
#=====================================================================
+# VER 2.6.6 - (2013-07-04)
+# - detect --events support in mysqldump and use it when available
# VER 2.6.5 - (2013-06-26)
# - detect qmail sendmail binary (option -r is not supported in qmail)
# VER 2.6.4 - (2011-07-03)
@@ -432,6 +434,14 @@
fi
}
+function get_events_support {
+ if [ -z "`${MYSQLDUMP} --events 2>&1 | ${GREP} \"unknown option\"`" ] ; then
+ echo 1
+ else
+ echo 0
+ fi
+}
+
if [ -z "${NAIL}" ] ; then
if [ -n "${MAIL}" ] ; then
if [ -n "`${MAIL} -r 2>&1 | grep \"invalid option -- r\"`" ]; then
@@ -503,7 +513,12 @@
LOGFILE=${BACKUPDIR}/${DBHOST}-`${DATEC} +%N`.log # Logfile Name
LOGERR=${BACKUPDIR}/ERRORS_${DBHOST}-`${DATEC} +%N`.log # Logfile Name
BACKUPFILES=""
-OPT="--quote-names --opt --single-transaction --routines" # OPT string for use with mysqldump ( see man mysqldump )
+
+if [ "`get_events_support`" == "1" ] ; then
+ OPT="--events --ignore-table=mysql.events --quote-names --opt --single-transaction --routines" # OPT string for use with mysqldump ( see man mysqldump )
+else
+ OPT="--quote-names --opt --single-transaction --routines" # OPT string for use with mysqldump ( see man mysqldump )
+fi
# IO redirection for logging.
touch ${LOGFILE}
|