[-]
[+]
|
Changed |
automysqlbackup.spec
|
|
[-]
[+]
|
Changed |
automysqlbackup-2.6.4.sh
^
|
@@ -43,6 +43,9 @@
# Host name (or IP address) of MySQL server e.g localhost
DBHOST=`echo ${DBHOST:=localhost}`
+
+ # Port where MYSQL Server is listening
+ DBPORT=`echo $[DBPORT:=3306}`
# List of DBNAMES for Daily/Weekly Backup e.g. "DB1 DB2 DB3"
DBNAMES=`echo ${DBNAMES:="DB1 DB2 DB3"}`
@@ -536,7 +539,7 @@
# Database dump function
dbdump () {
-${MYSQLDUMP} --user=${USERNAME} --password=${PASSWORD} --host=${DBHOST} ${OPT} ${1} > ${2}
+${MYSQLDUMP} --user=${USERNAME} --password=${PASSWORD} --host=${DBHOST} --port=${DBPORT} ${OPT} ${1} > ${2}
return $?
}
@@ -544,12 +547,12 @@
if [ "$COMP" = "gzip" ]; then
${ECHO} Backup Information for "${1}.gz"
SUFFIX=".gz"
- ${MYSQLDUMP} --user=${USERNAME} --password=${PASSWORD} --host=${DBHOST} ${OPT} ${1} | ${GZIP} > ${2}${SUFFIX}
+ ${MYSQLDUMP} --user=${USERNAME} --password=${PASSWORD} --host=${DBHOST} --port=${DBPORT} ${OPT} ${1} | ${GZIP} > ${2}${SUFFIX}
${GZIP} -l "$1.gz"
elif [ "$COMP" = "bzip2" ]; then
${ECHO} Compression information for "${1}.bz2"
SUFFIX=".bz2"
- ${MYSQLDUMP} --user=${USERNAME} --password=${PASSWORD} --host=${DBHOST} ${OPT} ${1} | ${BZIP2} -v 2>&1 > ${2}${SUFFIX}
+ ${MYSQLDUMP} --user=${USERNAME} --password=${PASSWORD} --host=${DBHOST} --port=${DBPORT} ${OPT} ${1} | ${BZIP2} -v 2>&1 > ${2}${SUFFIX}
else
${ECHO} "No compression option set, check advanced settings"
fi
@@ -560,7 +563,7 @@
if [ -n "`echo ${TABLEEXCLUDE} | grep \"${1}.${2}\"`" ] ; then
OPT=`echo ${OPT} | ${SED} -e 's@ --opt @ --skip-opt @'`
fi
-${MYSQLDUMP} --user=${USERNAME} --password=${PASSWORD} --host=${DBHOST} ${OPT} ${1} ${2} > ${3}
+${MYSQLDUMP} --user=${USERNAME} --password=${PASSWORD} --host=${DBHOST} --port=${DBPORT} ${OPT} ${1} ${2} > ${3}
return $?
}
@@ -572,12 +575,12 @@
echo
echo Backup Information for "$3.gz"
SUFFIX=".gz"
- ${MYSQLDUMP} --user=${USERNAME} --password=${PASSWORD} --host=${DBHOST} ${OPT} ${1} ${2} | ${GZIP} > ${3}${SUFFIX}
+ ${MYSQLDUMP} --user=${USERNAME} --password=${PASSWORD} --host=${DBHOST} --port=${DBPORT} ${OPT} ${1} ${2} | ${GZIP} > ${3}${SUFFIX}
${GZIP} -l "${3}.gz"
elif [ "${COMP}" = "bzip2" ]; then
echo Compression information for "${3}.bz2"
SUFFIX=".bz2"
- ${MYSQLDUMP} --user=${USERNAME} --password=${PASSWORD} --host=${DBHOST} ${OPT} ${1} ${2} | ${BZIP2} -v 2>&1 > ${3}${SUFFIX}
+ ${MYSQLDUMP} --user=${USERNAME} --password=${PASSWORD} --host=${DBHOST} --port=${DBPORT} ${OPT} ${1} ${2} | ${BZIP2} -v 2>&1 > ${3}${SUFFIX}
else
echo "No compression option set, check advanced settings"
fi
|
[-]
[+]
|
Changed |
multimysqlbackup.conf
^
|
@@ -5,5 +5,5 @@
# host;user;password;databases_separated_by_spaces;exclude_databases;exclude_tables
# samples:
# localhost;root;;all;
-# localhost;root;password;mysql my_first_database my_second_database;exclude1_db exclude2_db;exclude3_db.exclude_table1 exclude4_db.exclude_table2
+# localhost:port;root;password;mysql my_first_database my_second_database;exclude1_db exclude2_db;exclude3_db.exclude_table1 exclude4_db.exclude_table2
|
[-]
[+]
|
Changed |
multimysqlbackup.sh
^
|
@@ -31,7 +31,8 @@
# format: host;user;password;databases_separated_by_spaces;databases_to_exclude_separated_by_spaces;tables_to_exclude
- export DBHOST=`echo ${LINE} | awk -F\; '{print $1}'`
+ export DBHOST=`echo ${LINE} | awk -F\; '{print $1}' | awk -F: '{print $1}'`
+ export DBPORT=`echo ${LINE} | awk -F\; '{print $1}' | awk -F: '{print $2}'`
export USERNAME=`echo ${LINE} | awk -F\; '{print $2}'`
export PASSWORD=`echo ${LINE} | awk -F\; '{print $3}'`
export DBNAMES=`echo ${LINE} | awk -F\; '{print $4}'|sed -e s@"%20%"@" "@g`
@@ -62,6 +63,7 @@
if [ -s /usr/local/psa/version ] && [ -s /etc/psa/.psa.shadow ] ; then
export DBHOST="localhost"
+ export DBPORT="3306"
export USERNAME="admin"
export PASSWORD=`cat /etc/psa/.psa.shadow`
export DBNAMES="all"
|