Current location

narf Source control manager Git

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshtrom <shtrom@1991c358-8f32-0410-a49a-990740bdf4c2>2014-07-23 12:07:46 +0000
committershtrom <shtrom@1991c358-8f32-0410-a49a-990740bdf4c2>2014-07-23 12:07:46 +0000
commitf1a8fd133d9d5841b537522710e2fd724e1a7037 (patch)
tree227298d3cedc296a49701686044c2751837577a2 /openbsd
parent8d66b298ed70d15706ef5674996b30ee63f9d01c (diff)
Save MySQL databases in rdiff-backupable ocation
git-svn-id: svn+ssh://scm.narf.ssji.net/svn/shtrom/scripts@1905 1991c358-8f32-0410-a49a-990740bdf4c2
Diffstat (limited to 'openbsd')
-rwxr-xr-xopenbsd/backup.sh9
1 files changed, 3 insertions, 6 deletions
diff --git a/openbsd/backup.sh b/openbsd/backup.sh
index 5b88123..b188c0c 100755
--- a/openbsd/backup.sh
+++ b/openbsd/backup.sh
@@ -7,7 +7,7 @@ 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/"
-MYSQLDUMPDIR="/srv/backup/"
+MYSQLDUMPDIR="/srv/dbdumps/"
MYSQLUSER="dumper"
TMPSUBDIR=/tmp
@@ -32,14 +32,11 @@ fi
echo -n "Dumping databases:"
if [ ! -z "$MYSQLDUMPDIR" ]; then
- MYSQLDUMP="${MYSQLDUMPDIR}mysql.$(date +%Y-%m-%d_%H:%M).dump.sql"
+ MYSQLDUMP="${MYSQLDUMPDIR}mysql.dump.sql"
echo -n " mysql (${MYSQLDUMP})"
# GRANT SELECT, SHOW VIEW, TRIGGER, LOCK TABLES ON *.* TO 'dumper'@'localhost';
- mysqldump -u ${MYSQLUSER} -A -E > ${MYSQLDUMP}
+ mysqldump --comments --dump-date -u ${MYSQLUSER} -A --events --ignore-table=mysql.event > ${MYSQLDUMP}
mysqldump-grants -u ${MYSQLUSER} >> ${MYSQLDUMP}
- if [ "$1" = "remote" ]; then
- scp ${MYSQLDUMP} ${REMOTEBACKUPDIR}
- fi
fi
echo "."