Current location

narf Source control manager Git

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshtrom <shtrom@1991c358-8f32-0410-a49a-990740bdf4c2>2008-08-12 04:33:14 +0000
committershtrom <shtrom@1991c358-8f32-0410-a49a-990740bdf4c2>2008-08-12 04:33:14 +0000
commita033505a3953afcd4284f16bd745283f07ccad41 (patch)
tree3a6a72ff4a861f3290218bb601f388eafc3a7475 /openbsd
parentc6d28b2661fddeb8ef97053b20d36c839ed452f9 (diff)
[OpenBSD-scripts] Cleaner exclusion of backup folder from being backed up.
git-svn-id: svn+ssh://scm.narf.ssji.net/svn/shtrom/scripts@396 1991c358-8f32-0410-a49a-990740bdf4c2
Diffstat (limited to 'openbsd')
-rwxr-xr-xopenbsd/backup.sh7
1 files changed, 6 insertions, 1 deletions
diff --git a/openbsd/backup.sh b/openbsd/backup.sh
index 234a644..772e491 100755
--- a/openbsd/backup.sh
+++ b/openbsd/backup.sh
@@ -6,6 +6,11 @@ BACKUPDIR="/srv/rdiff-backup"
echo -n "Backing up to ${BACKUPDIR}:"
for DIR in $DIRS; do
echo -n " $DIR"
- /usr/local/bin/rdiff-backup --exclude $BACKUPDIR $DIR $BACKUPDIR$DIR
+ if [ "`dirname $BACKUPDIR`" = "$DIR" ]; then
+ EXCL="--exclude $BACKUPDIR"
+ else
+ EXCL=""
+ fi
+ /usr/local/bin/rdiff-backup $EXCL $DIR $BACKUPDIR$DIR
done
echo "."