Current location

narf Source control manager Git

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshtrom <shtrom@1991c358-8f32-0410-a49a-990740bdf4c2>2010-07-13 09:02:26 +0000
committershtrom <shtrom@1991c358-8f32-0410-a49a-990740bdf4c2>2010-07-13 09:02:26 +0000
commit3739dea0095fa36076cf9edf475d054765bdbdbe (patch)
tree7423ae3671d4ba45c9545d5a5692bccb50a6d01d /openbsd
parent93739ab857c82a9ec1ffcde65d42a8258dd2a5d0 (diff)
[backup.sh] Better directory logic Better directory logicss
git-svn-id: svn+ssh://scm.narf.ssji.net/svn/shtrom/scripts@815 1991c358-8f32-0410-a49a-990740bdf4c2
Diffstat (limited to 'openbsd')
-rwxr-xr-xopenbsd/backup.sh12
1 files changed, 6 insertions, 6 deletions
diff --git a/openbsd/backup.sh b/openbsd/backup.sh
index 058ac6a..d4c2a1c 100755
--- a/openbsd/backup.sh
+++ b/openbsd/backup.sh
@@ -1,24 +1,24 @@
#!/bin/sh
# $Id$
DIRS="/etc /srv /home/shtrom"
-BACKUPDIR="/srv/rdiff-backup"
-LOCALBACKUPDIR="/srv/rdiff-backup/`hostname -s`"
+BACKUPROOT="/srv/rdiff-backup"
+BACKUPDIR="${BACKUPROOT}/`hostname -s`"
BACKUPSERVER=backup.narf.ssji.net
-REMOTEBACKUPDIR="`hostname -s`@${BACKUPSERVER}::${BACKUPDIR}/`hostname -s`"
+REMOTEBACKUPDIR="`hostname -s`@${BACKUPSERVER}::${BACKUPDIR}"
if [ "$1" = "remote" ]; then
EFFECTIVEBACKUPDIR=${REMOTEBACKUPDIR}
REMOTESCHEMA="ssh -qT -i /etc/ssh/ssh_host_rsa_key %s"
else
- EFFECTIVEBACKUPDIR=${LOCALBACKUPDIR}
+ EFFECTIVEBACKUPDIR=${BACKUPDIR}
REMOTESCHEMA=""
fi
echo -n "Backing up to ${EFFECTIVEBACKUPDIR}:"
for DIR in $DIRS; do
echo -n " $DIR"
- if [ "`dirname $BACKUPDIR`" = "$DIR" ]; then
- EXCL="--exclude $BACKUPDIR"
+ if [ "`dirname $BACKUPROOT`" = "$DIR" ]; then
+ EXCL="--exclude $BACKUPROOT"
else
EXCL=""
fi