[-]
[+]
|
Changed |
automysqlbackup.spec
|
|
[-]
[+]
|
Changed |
automysqlbackup-2.6.4.sh
^
|
@@ -1,7 +1,7 @@
#!/bin/bash
#
# MySQL Backup Script
-# VER. 2.5.1 - http://sourceforge.net/projects/automysqlbackup/
+# VER. 2.6.4 - http://sourceforge.net/projects/automysqlbackup/
# Copyright (c) 2002-2003 wipe_out@lycos.co.uk
#
# This program is free software; you can redistribute it and/or modify
|
[-]
[+]
|
Changed |
multimysqlbackup.sh
^
|
@@ -4,7 +4,7 @@
# Summary: wrapper for automysqlbackup to backup multiple hosts
# Version: 0.2
# Author: Carsten Schoene <cs@linux-administrator.com>
-# Last change: 26-06-2009
+# Last change: 21-10-2011
#
###############################################################################
@@ -16,6 +16,12 @@
# lock each job
LOCKJOB=1
+
+# enable plesk detection
+AUTOPLESKBACKUP=1
+
+# disable output on skipped configs
+SILENTERROR=1
###############################################################################
if [ -s "${CONFPATH}" ] ; then
@@ -41,14 +47,41 @@
elif [ "${LOCKJOB}" == "0" ] ; then
${AUTOMYSQLBACKUP}
else
- echo "LOCKJOB is enabled and /var/lock/${DBHOST}.lock file was found, please check. Script skips backup for host: ${DBHOST}"
+ echo "LOCKJOB is enabled and /var/lock/${DBHOST}.lock file was found, please check! Script skips backup for host: ${DBHOST}"
exit 2
fi
done
-
else
-
- echo "Config file not found: ${CONFPATH}"
- exit 1
+ if [ "${SILENTERROR}" == "0" ] ; then
+ echo "Config file not found: ${CONFPATH} (skipping)"
+ fi
fi
+if [ "${AUTOPLESKBACKUP}" == "1" ] ; then
+ # plesk autodetection
+ if [ -s /usr/local/psa/version ] && [ -s /etc/psa/.psa.shadow ] ; then
+
+ export DBHOST="localhost"
+ export USERNAME="admin"
+ export PASSWORD=`cat /etc/psa/.psa.shadow`
+ export DBNAMES="all"
+ export DBEXCLUDE=""
+ export TABLEEXCLUDE=""
+ if [ ! -f /var/lock/${DBHOST}.lock ] && [ "${LOCKJOB}" == "1" ] ; then
+
+ touch /var/lock/${DBHOST}.lock
+ ${AUTOMYSQLBACKUP}
+ rm -f /var/lock/${DBHOST}.lock
+
+ elif [ "${LOCKJOB}" == "0" ] ; then
+ ${AUTOMYSQLBACKUP}
+ else
+ echo "LOCKJOB is enabled and /var/lock/${DBHOST}.lock file was found, please check! Script skips backup for host: ${DBHOST}"
+ exit 3
+ fi
+ else
+ if [ "${SILENTERROR}" == "0" ] ; then
+ echo "Plesk configuration not found: /usr/local/psa/version & /etc/psa/.psa.shadow (skipping)"
+ fi
+ fi
+fi
|