Current location

narf Source control manager Git

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshtrom <shtrom@1991c358-8f32-0410-a49a-990740bdf4c2>2009-08-14 10:06:39 +0000
committershtrom <shtrom@1991c358-8f32-0410-a49a-990740bdf4c2>2009-08-14 10:06:39 +0000
commitea6b672045a5dc55e865564fb0d39245085ea0e6 (patch)
tree31d3da78e421d392c38af0d6a6745f1e90c8b33f /openbsd
parent43d3b47b28d02c1640e87966b5cff21b2616eb5e (diff)
[OpenBSD script] Cleanup in the backup script.
git-svn-id: svn+ssh://scm.narf.ssji.net/svn/shtrom/scripts@623 1991c358-8f32-0410-a49a-990740bdf4c2
Diffstat (limited to 'openbsd')
-rwxr-xr-xopenbsd/backup.sh18
1 files changed, 10 insertions, 8 deletions
diff --git a/openbsd/backup.sh b/openbsd/backup.sh
index 7d25832..058ac6a 100755
--- a/openbsd/backup.sh
+++ b/openbsd/backup.sh
@@ -1,25 +1,27 @@
#!/bin/sh
# $Id$
DIRS="/etc /srv /home/shtrom"
-LOCALBACKUPDIR="/srv/rdiff-backup"
-REMOTEBACKUPDIR="`hostname -s`@backup.narf.ssji.net::/srv/rdiff-backup/`hostname -s`/"
+BACKUPDIR="/srv/rdiff-backup"
+LOCALBACKUPDIR="/srv/rdiff-backup/`hostname -s`"
+BACKUPSERVER=backup.narf.ssji.net
+REMOTEBACKUPDIR="`hostname -s`@${BACKUPSERVER}::${BACKUPDIR}/`hostname -s`"
if [ "$1" = "remote" ]; then
- BACKUPDIR=${REMOTEBACKUPDIR}
+ EFFECTIVEBACKUPDIR=${REMOTEBACKUPDIR}
REMOTESCHEMA="ssh -qT -i /etc/ssh/ssh_host_rsa_key %s"
else
- BACKUPDIR=${LOCALBACKUPDIR}
+ EFFECTIVEBACKUPDIR=${LOCALBACKUPDIR}
REMOTESCHEMA=""
fi
-echo -n "Backing up to ${BACKUPDIR}:"
+echo -n "Backing up to ${EFFECTIVEBACKUPDIR}:"
for DIR in $DIRS; do
echo -n " $DIR"
- if [ "`dirname $LOCALBACKUPDIR`" = "$DIR" ]; then
- EXCL="--exclude $LOCALBACKUPDIR"
+ if [ "`dirname $BACKUPDIR`" = "$DIR" ]; then
+ EXCL="--exclude $BACKUPDIR"
else
EXCL=""
fi
- /usr/local/bin/rdiff-backup --create-full-path ${REMOTESCHEMA:+--remote-schema "${REMOTESCHEMA}"} $EXCL $DIR $BACKUPDIR$DIR
+ /usr/local/bin/rdiff-backup --create-full-path ${REMOTESCHEMA:+--remote-schema "${REMOTESCHEMA}"} $EXCL $DIR $EFFECTIVEBACKUPDIR$DIR
done
echo "."