Current location

narf Source control manager Git

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshtrom <shtrom@1991c358-8f32-0410-a49a-990740bdf4c2>2014-07-23 08:29:02 +0000
committershtrom <shtrom@1991c358-8f32-0410-a49a-990740bdf4c2>2014-07-23 08:29:02 +0000
commit8d66b298ed70d15706ef5674996b30ee63f9d01c (patch)
tree0788344dcf7d2c31c20033fd78dc36c77f9b193d
parent8b110f9c611ac15416ad404da0b07bd510106a36 (diff)
scp mysql backups to remote
git-svn-id: svn+ssh://scm.narf.ssji.net/svn/shtrom/scripts@1904 1991c358-8f32-0410-a49a-990740bdf4c2
-rwxr-xr-xopenbsd/backup.sh6
1 files changed, 4 insertions, 2 deletions
diff --git a/openbsd/backup.sh b/openbsd/backup.sh
index f43a577..5b88123 100755
--- a/openbsd/backup.sh
+++ b/openbsd/backup.sh
@@ -32,12 +32,14 @@ fi
echo -n "Dumping databases:"
if [ ! -z "$MYSQLDUMPDIR" ]; then
- MYSQLDUMP="${MYSQLDUMPDIR}/mysql.$(date +%Y-%m-%d_%H:%M).dump.sql"
+ MYSQLDUMP="${MYSQLDUMPDIR}mysql.$(date +%Y-%m-%d_%H:%M).dump.sql"
echo -n " mysql (${MYSQLDUMP})"
# GRANT SELECT, SHOW VIEW, TRIGGER, LOCK TABLES ON *.* TO 'dumper'@'localhost';
mysqldump -u ${MYSQLUSER} -A -E > ${MYSQLDUMP}
mysqldump-grants -u ${MYSQLUSER} >> ${MYSQLDUMP}
-
+ if [ "$1" = "remote" ]; then
+ scp ${MYSQLDUMP} ${REMOTEBACKUPDIR}
+ fi
fi
echo "."