Changes of Revision 23
[-] | Changed | automysqlbackup.spec |
x 1
2 Name: automysqlbackup 3 -Version: 2.6.5 4 +Version: 2.6.6 5 Release: 1 6 Group: System/Backup 7 Summary: MySQL backup script 8
9 %{_mandir}/man8/automysqlbackup.8* 10 11 %changelog 12 +* Thu Jul 04 2013 Carsten Schoene <cs@linux-administrator.com> - 2.6.6-1 13 +- detect --events support in mysqldump and use it when available 14 + 15 * Wed Jun 26 2013 Carsten Schoene <cs@linux-administrator.com> - 2.6.5-1 16 - detect qmail sendmail binary replacement and adapt mailcmd according to it, 17 qmails sendmail does not support -r option 18 |
||
[+] | 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} |