Current location

narf Source control manager Git

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshtrom <shtrom@1991c358-8f32-0410-a49a-990740bdf4c2>2009-04-22 05:51:17 +0000
committershtrom <shtrom@1991c358-8f32-0410-a49a-990740bdf4c2>2009-04-22 05:51:17 +0000
commitb583bc381fa2ffb81ce3944fee27f5d3712307f3 (patch)
tree567bdeec95ab9ed3145cd1d5aeba63765e1a7d73 /openbsd
parent28fba3e067c276e23698fd6c4476eba6a2dcf06e (diff)
[OpenBSD scripts] Better approach to remote backups (not saving local
backups...). git-svn-id: svn+ssh://scm.narf.ssji.net/svn/shtrom/scripts@520 1991c358-8f32-0410-a49a-990740bdf4c2
Diffstat (limited to 'openbsd')
-rwxr-xr-xopenbsd/backup.sh15
1 files changed, 9 insertions, 6 deletions
diff --git a/openbsd/backup.sh b/openbsd/backup.sh
index 604ab18..7d25832 100755
--- a/openbsd/backup.sh
+++ b/openbsd/backup.sh
@@ -1,19 +1,22 @@
#!/bin/sh
# $Id$
DIRS="/etc /srv /home/shtrom"
-BACKUPDIR="/srv/rdiff-backup"
-MONTHLYBACKUPDIR="`hostname -s`@backup.narf.ssji.net::/srv/rdiff-backup/`hostname -s`/"
+LOCALBACKUPDIR="/srv/rdiff-backup"
+REMOTEBACKUPDIR="`hostname -s`@backup.narf.ssji.net::/srv/rdiff-backup/`hostname -s`/"
-if [ "$1" = "monthly" ]; then
- BACKUPDIR=${MONTHLYBACKUPDIR}
+if [ "$1" = "remote" ]; then
+ BACKUPDIR=${REMOTEBACKUPDIR}
REMOTESCHEMA="ssh -qT -i /etc/ssh/ssh_host_rsa_key %s"
+else
+ BACKUPDIR=${LOCALBACKUPDIR}
+ REMOTESCHEMA=""
fi
echo -n "Backing up to ${BACKUPDIR}:"
for DIR in $DIRS; do
echo -n " $DIR"
- if [ "`dirname $BACKUPDIR`" = "$DIR" ]; then
- EXCL="--exclude $BACKUPDIR"
+ if [ "`dirname $LOCALBACKUPDIR`" = "$DIR" ]; then
+ EXCL="--exclude $LOCALBACKUPDIR"
else
EXCL=""
fi