Current location

narf Source control manager Git

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshtrom <shtrom@1991c358-8f32-0410-a49a-990740bdf4c2>2009-04-14 09:10:35 +0000
committershtrom <shtrom@1991c358-8f32-0410-a49a-990740bdf4c2>2009-04-14 09:10:35 +0000
commit28fba3e067c276e23698fd6c4476eba6a2dcf06e (patch)
treecbc365e74ba0d7b47723cafbdedcace582db51b5 /openbsd
parent1f751cbcf7cb4da5245f7f98cd4833e27b6f1ec3 (diff)
[OpenBSD scripts] Backup script now handles remote backups.
git-svn-id: svn+ssh://scm.narf.ssji.net/svn/shtrom/scripts@516 1991c358-8f32-0410-a49a-990740bdf4c2
Diffstat (limited to 'openbsd')
-rwxr-xr-xopenbsd/backup.sh8
1 files changed, 7 insertions, 1 deletions
diff --git a/openbsd/backup.sh b/openbsd/backup.sh
index 772e491..604ab18 100755
--- a/openbsd/backup.sh
+++ b/openbsd/backup.sh
@@ -2,6 +2,12 @@
# $Id$
DIRS="/etc /srv /home/shtrom"
BACKUPDIR="/srv/rdiff-backup"
+MONTHLYBACKUPDIR="`hostname -s`@backup.narf.ssji.net::/srv/rdiff-backup/`hostname -s`/"
+
+if [ "$1" = "monthly" ]; then
+ BACKUPDIR=${MONTHLYBACKUPDIR}
+ REMOTESCHEMA="ssh -qT -i /etc/ssh/ssh_host_rsa_key %s"
+fi
echo -n "Backing up to ${BACKUPDIR}:"
for DIR in $DIRS; do
@@ -11,6 +17,6 @@ for DIR in $DIRS; do
else
EXCL=""
fi
- /usr/local/bin/rdiff-backup $EXCL $DIR $BACKUPDIR$DIR
+ /usr/local/bin/rdiff-backup --create-full-path ${REMOTESCHEMA:+--remote-schema "${REMOTESCHEMA}"} $EXCL $DIR $BACKUPDIR$DIR
done
echo "."