2006-10-20 01:56:13 +02:00
|
|
|
$NetBSD: patch-aa,v 1.3 2006/10/19 23:56:13 rillig Exp $
|
Initial import of tob-0.25 into the NetBSD Packages Collection.
This has been placed in sysutils rather than archivers since it doesn't
conform to the other archivers packages.
The nudge came from a netbsd-help posting by Thomas Hafner and a URL
posted by Jeremy Reed.
tob is a general driver for making and maintaining backups.
Given a set of `volume definitions', it creates arj, tar or afio based
backups, and stores them either to a device in /dev, or a file in the
filesystem, to be burned to optical media later, moved off to other
machines, etc. Through a straightforward configuration file, you can
instruct tob to mount and unmount devices before beginning backups.
tob supports full backups, differential backups (of the files which
were changed since the last full backup), and incremental backups (of
files changed since any previous backups). It lets you determine the
size of the backup before actually making it, maintain listings of
made backups, make remote backups and possibly more.
2003-06-27 14:01:12 +02:00
|
|
|
|
2006-10-20 01:56:13 +02:00
|
|
|
--- tob.orig 2003-06-06 22:05:57.000000000 +0200
|
|
|
|
+++ tob 2006-10-20 01:48:50.000000000 +0200
|
Initial import of tob-0.25 into the NetBSD Packages Collection.
This has been placed in sysutils rather than archivers since it doesn't
conform to the other archivers packages.
The nudge came from a netbsd-help posting by Thomas Hafner and a URL
posted by Jeremy Reed.
tob is a general driver for making and maintaining backups.
Given a set of `volume definitions', it creates arj, tar or afio based
backups, and stores them either to a device in /dev, or a file in the
filesystem, to be burned to optical media later, moved off to other
machines, etc. Through a straightforward configuration file, you can
instruct tob to mount and unmount devices before beginning backups.
tob supports full backups, differential backups (of the files which
were changed since the last full backup), and incremental backups (of
files changed since any previous backups). It lets you determine the
size of the backup before actually making it, maintain listings of
made backups, make remote backups and possibly more.
2003-06-27 14:01:12 +02:00
|
|
|
@@ -13,8 +13,8 @@
|
|
|
|
#
|
|
|
|
|
|
|
|
# File locations
|
|
|
|
-TOBLISTS=/var/lib/tob
|
|
|
|
-TOBHOME=/etc/tob
|
2006-10-20 01:56:13 +02:00
|
|
|
+TOBLISTS=@VARBASE@/tob
|
Initial import of tob-0.25 into the NetBSD Packages Collection.
This has been placed in sysutils rather than archivers since it doesn't
conform to the other archivers packages.
The nudge came from a netbsd-help posting by Thomas Hafner and a URL
posted by Jeremy Reed.
tob is a general driver for making and maintaining backups.
Given a set of `volume definitions', it creates arj, tar or afio based
backups, and stores them either to a device in /dev, or a file in the
filesystem, to be burned to optical media later, moved off to other
machines, etc. Through a straightforward configuration file, you can
instruct tob to mount and unmount devices before beginning backups.
tob supports full backups, differential backups (of the files which
were changed since the last full backup), and incremental backups (of
files changed since any previous backups). It lets you determine the
size of the backup before actually making it, maintain listings of
made backups, make remote backups and possibly more.
2003-06-27 14:01:12 +02:00
|
|
|
+TOBHOME=@PKG_SYSCONFDIR@/tob
|
|
|
|
|
|
|
|
############################################################################
|
|
|
|
# Global settings, most of which can be overruled in the resource file:
|
2006-10-20 01:56:13 +02:00
|
|
|
@@ -77,13 +77,17 @@ then
|
Initial import of tob-0.25 into the NetBSD Packages Collection.
This has been placed in sysutils rather than archivers since it doesn't
conform to the other archivers packages.
The nudge came from a netbsd-help posting by Thomas Hafner and a URL
posted by Jeremy Reed.
tob is a general driver for making and maintaining backups.
Given a set of `volume definitions', it creates arj, tar or afio based
backups, and stores them either to a device in /dev, or a file in the
filesystem, to be burned to optical media later, moved off to other
machines, etc. Through a straightforward configuration file, you can
instruct tob to mount and unmount devices before beginning backups.
tob supports full backups, differential backups (of the files which
were changed since the last full backup), and incremental backups (of
files changed since any previous backups). It lets you determine the
size of the backup before actually making it, maintain listings of
made backups, make remote backups and possibly more.
2003-06-27 14:01:12 +02:00
|
|
|
fi
|
|
|
|
elif [ -x /usr/bin/mktemp ]
|
|
|
|
then
|
|
|
|
- TMPLIST=`mktemp -p tob`
|
|
|
|
+ case `uname -s` in
|
|
|
|
+ NetBSD) prefarg="-t" ;;
|
|
|
|
+ *) prefarg="-p" ;;
|
|
|
|
+ esac
|
|
|
|
+ TMPLIST=`mktemp $prefarg tob`
|
|
|
|
rc1=$?
|
|
|
|
- FILELIST=`mktemp -p tob`
|
|
|
|
+ FILELIST=`mktemp $prefarg tob`
|
|
|
|
rc2=$?
|
|
|
|
- TMPLIST1=`mktemp -p tob`
|
|
|
|
+ TMPLIST1=`mktemp $prefarg tob`
|
|
|
|
rc3=$?
|
|
|
|
- TMPLIST2=`mktemp -p tob`
|
|
|
|
+ TMPLIST2=`mktemp $prefarg tob`
|
|
|
|
rc4=$?
|
|
|
|
if [ $rc1 -ne 0 -o $rc2 -ne 0 -o $rc3 -ne 0 -o $rc4 -ne 0 ]
|
|
|
|
then
|
2006-10-20 01:56:13 +02:00
|
|
|
@@ -131,7 +135,7 @@ POSTCMD=''
|
Initial import of tob-0.25 into the NetBSD Packages Collection.
This has been placed in sysutils rather than archivers since it doesn't
conform to the other archivers packages.
The nudge came from a netbsd-help posting by Thomas Hafner and a URL
posted by Jeremy Reed.
tob is a general driver for making and maintaining backups.
Given a set of `volume definitions', it creates arj, tar or afio based
backups, and stores them either to a device in /dev, or a file in the
filesystem, to be burned to optical media later, moved off to other
machines, etc. Through a straightforward configuration file, you can
instruct tob to mount and unmount devices before beginning backups.
tob supports full backups, differential backups (of the files which
were changed since the last full backup), and incremental backups (of
files changed since any previous backups). It lets you determine the
size of the backup before actually making it, maintain listings of
made backups, make remote backups and possibly more.
2003-06-27 14:01:12 +02:00
|
|
|
VER=0.25
|
|
|
|
|
|
|
|
# RCLIST: list of resource files which tob will search for
|
|
|
|
-RCLIST='/usr/local/etc/tob.rc /etc/tob/tob.rc /etc/tob.rc /usr/etc/tob.rc'
|
|
|
|
+RCLIST='@PKG_SYSCONFDIR@/tob/tob.rc /usr/local/etc/tob.rc /etc/tob/tob.rc /etc/tob.rc /usr/etc/tob.rc'
|
|
|
|
|
|
|
|
############################################################################
|
|
|
|
# show a message to the screen
|
2006-10-20 01:56:13 +02:00
|
|
|
@@ -189,6 +193,10 @@ checkenv ()
|
Initial import of tob-0.25 into the NetBSD Packages Collection.
This has been placed in sysutils rather than archivers since it doesn't
conform to the other archivers packages.
The nudge came from a netbsd-help posting by Thomas Hafner and a URL
posted by Jeremy Reed.
tob is a general driver for making and maintaining backups.
Given a set of `volume definitions', it creates arj, tar or afio based
backups, and stores them either to a device in /dev, or a file in the
filesystem, to be burned to optical media later, moved off to other
machines, etc. Through a straightforward configuration file, you can
instruct tob to mount and unmount devices before beginning backups.
tob supports full backups, differential backups (of the files which
were changed since the last full backup), and incremental backups (of
files changed since any previous backups). It lets you determine the
size of the backup before actually making it, maintain listings of
made backups, make remote backups and possibly more.
2003-06-27 14:01:12 +02:00
|
|
|
if [ "$EXT" = "" ] ; then
|
|
|
|
error "variable EXT is undefined"
|
|
|
|
fi
|
|
|
|
+
|
|
|
|
+ case "$UID" in
|
|
|
|
+ "") UID=`id -u` ;;
|
|
|
|
+ esac
|
|
|
|
|
|
|
|
if [ "$NEEDROOT" = "yes" ] ; then
|
|
|
|
if [ $UID -ne 0 ]; then
|
2006-10-20 01:56:13 +02:00
|
|
|
@@ -583,10 +591,10 @@ full ()
|
|
|
|
|
|
|
|
cd $BACKUPDIR
|
|
|
|
for i in `find ${VOLUMENAME}_* -mtime +$MAXBACKUPAGE -exec echo {} \;`; do
|
|
|
|
- if [ $i == $UPTO ]; then
|
|
|
|
+ if [ $i = $UPTO ]; then
|
|
|
|
SEEN=1
|
|
|
|
fi
|
|
|
|
- if [ $SEEN == '0' ]; then
|
|
|
|
+ if [ $SEEN = '0' ]; then
|
|
|
|
message "Deleted old backup $i"
|
|
|
|
$RM -f $i
|
|
|
|
fi
|
|
|
|
@@ -652,10 +660,10 @@ differential ()
|
|
|
|
cd $BACKUPDIR
|
|
|
|
$RM -f ${VOLUMENAME}_*inc*
|
|
|
|
for i in `find ${VOLUMENAME}_*diff* -mtime +$MAXBACKUPAGE -exec echo {} \;`; do
|
|
|
|
- if [ $i == $UPTO ]; then
|
|
|
|
+ if [ $i = $UPTO ]; then
|
|
|
|
SEEN=1
|
|
|
|
fi
|
|
|
|
- if [ $SEEN == '0' ]; then
|
|
|
|
+ if [ $SEEN = '0' ]; then
|
|
|
|
message "Deleting old backup $i"
|
|
|
|
$RM -f $i
|
|
|
|
fi
|