Current location

narf Source control manager Git

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshtrom <shtrom@1991c358-8f32-0410-a49a-990740bdf4c2>2014-08-04 05:25:33 +0000
committershtrom <shtrom@1991c358-8f32-0410-a49a-990740bdf4c2>2014-08-04 05:25:33 +0000
commit8f0994328f1f44fa3645ef65fadef0c5de74d495 (patch)
treee9b642d0984f973a4c40fb7a13951e1a33eaf539
parentc5c78e9cceb4e90a1a5e0690f62586bb928fcfca (diff)
[backup.sh] Fixing binary paths.
git-svn-id: svn+ssh://scm.narf.ssji.net/svn/shtrom/scripts@1964 1991c358-8f32-0410-a49a-990740bdf4c2
-rwxr-xr-xopenbsd/backup.sh12
1 files changed, 7 insertions, 5 deletions
diff --git a/openbsd/backup.sh b/openbsd/backup.sh
index 0f147ba..f3b609b 100755
--- a/openbsd/backup.sh
+++ b/openbsd/backup.sh
@@ -7,8 +7,10 @@ BACKUPSERVER=backup.narf.ssji.net
#REMOTEBACKUPDIR="`hostname -s`@${BACKUPSERVER}::${BACKUPDIR}"
REMOTEBACKUPDIR="`hostname -s`@${BACKUPSERVER}::/share/homes/`hostname -s`"
EXCLUDEALWAYS="${BACKUPROOT} /srv/backup/ /srv/www/sites/offlines.fr/"
+MYSQLBINPATH=/usr/local/bin/
MYSQLDUMPDIR="/srv/dbdumps/"
MYSQLUSER="dumper"
+LDAPBINPATH=/usr/local/bin/
LDAPDUMPDIR="/srv/dbdumps/"
LDAPUSER="cn=root,dc=example,dc=net"
TMPSUBDIR=/tmp
@@ -17,10 +19,10 @@ TMPSUBDIR=/tmp
# [0] http://serverfault.com/questions/8860/how-can-i-export-the-privileges-from-mysql-and-then-import-to-a-new-server/13050#13050
mysqldump-grants()
{
- mysql -B -N $@ -e "SELECT DISTINCT CONCAT(
+ ${MYSQLBINPATH}mysql -B -N $@ -e "SELECT DISTINCT CONCAT(
'SHOW GRANTS FOR \'', user, '\'@\'', host, '\';'
) AS query FROM mysql.user" | \
- mysql $@ | \
+ ${MYSQLBINPATH}mysql $@ | \
sed 's/\(GRANT .*\)/\1;/;s/^\(Grants for .*\)/## \1 ##/;/##/{x;p;x;}'
}
@@ -37,14 +39,14 @@ if [ ! -z "$MYSQLDUMPDIR" ]; then
MYSQLDUMP="${MYSQLDUMPDIR}mysql.dump.sql"
echo -n " mysql (${MYSQLDUMP})"
# GRANT SELECT, SHOW VIEW, TRIGGER, LOCK TABLES ON *.* TO 'dumper'@'localhost';
- mysqldump --comments --dump-date -u ${MYSQLUSER} -A --events --ignore-table=mysql.event > ${MYSQLDUMP}
+ ${MYSQLBINPATH}mysqldump --comments --dump-date -u ${MYSQLUSER} > ${MYSQLDUMP}
mysqldump-grants -u ${MYSQLUSER} >> ${MYSQLDUMP}
fi
if [ ! -z "$LDAPDUMPDIR" ]; then
- LDAPDUMP="${LDAPDUMPDIR}ldap.dump.sql"
+ LDAPDUMP="${LDAPDUMPDIR}ldap.dump.ldiff"
echo -n " ldap (${LDAPDUMP}) NOT"
- # ldapvi --out --host localhost -D ${LDAPUSER} > ${LDAPDUMP}
+ #${LDAPBINPATH}ldapvi --out --host localhost -D ${LDAPUSER} > ${LDAPDUMP}
fi
echo "."