[Autobackupmysql-svnmail] SF.net SVN: autobackupmysql:[4] autobackupmysql.sh
Brought to you by:
infyquest
|
From: <inf...@us...> - 2009-12-22 11:37:24
|
Revision: 4
http://autobackupmysql.svn.sourceforge.net/autobackupmysql/?rev=4&view=rev
Author: infyquest
Date: 2009-12-22 11:37:16 +0000 (Tue, 22 Dec 2009)
Log Message:
-----------
Add FreeBSD specific configuration check (thanks fraenski)
Fix typo in the configuration file check (thanks fraenski)
Fix for Socket file ignored when DBNAMES="all" given
Minor IO redirection fix
Modified Paths:
--------------
autobackupmysql.sh
Modified: autobackupmysql.sh
===================================================================
--- autobackupmysql.sh 2009-12-18 11:40:11 UTC (rev 3)
+++ autobackupmysql.sh 2009-12-22 11:37:16 UTC (rev 4)
@@ -30,8 +30,10 @@
# Check configuration files
if [ -f "autobackupmysql.conf" ] ; then
source "autobackupmysql.conf"
-elif [ - f "/etc/autobackupmysql.conf" ] ; then
+elif [ -f "/etc/autobackupmysql.conf" ] ; then
source "/etc/autobackupmysql.conf"
+elif [ -f "/usr/local/etc/autobackupmysql.conf" ] ; then
+ source "/usr/local/etc/autobackupmysql.conf"
else
# Username to access the MySQL server e.g. dbuser
USERNAME='dbuser'
@@ -261,6 +263,11 @@
# Change Log
#=====================================================================
#
+# VER 1.3 - (2009-12-22)
+# Add FreeBSD specific configuration check (thanks fraenski)
+# Fix typo in the configuration file check (thanks fraenski)
+# Fix for Socket file ignored when DBNAMES="all" given
+# Minor IO redirection fix
# VER 1.2 - (2009-12-18)
# Add support for configuration files
# VER 1.1 - (2009-12-10)
@@ -287,7 +294,7 @@
DOM=`date +%d` # Date of the Month e.g. 27
M=`date +%B` # Month e.g January
W=`date +%V` # Week Number e.g 37
-VER=1.2 # Version Number
+VER=1.3 # Version Number
LOGFILE=$BACKUPDIR/$DBHOST-`date +%N`.log # Logfile Name
LOGERR=$BACKUPDIR/ERRORS_$DBHOST-`date +%N`.log # Logfile Name
BACKUPFILES=""
@@ -435,8 +442,11 @@
# If backing up all DBs on the server
if [ "$DBNAMES" = "all" ]; then
+ if [ "$SOCKET" ]; then
+ DBNAMES="`mysql --user=$USERNAME --password=$PASSWORD --host=$DBHOST --socket=$SOCKET --batch --skip-column-names -e "show databases"| sed 's/ /%/g'`"
+ else
DBNAMES="`mysql --user=$USERNAME --password=$PASSWORD --host=$DBHOST --batch --skip-column-names -e "show databases"| sed 's/ /%/g'`"
-
+ fi
# If DBs are excluded
for exclude in $DBEXCLUDE
do
@@ -595,7 +605,7 @@
#Clean up IO redirection
exec 1>&6 6>&- # Restore stdout and close file descriptor #6.
-exec 1>&7 7>&- # Restore stdout and close file descriptor #7.
+exec 2>&7 7>&- # Restore stderr and close file descriptor #7.
if [ "$MAILCONTENT" = "files" ]
then
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|