--- tob-0.26.cvs.20040226.orig/debian/bug218681_tob.Dan.patch +++ tob-0.26.cvs.20040226/debian/bug218681_tob.Dan.patch @@ -0,0 +1,21 @@ +--- tob.orig.4 2004-03-10 23:29:43.000000000 -0500 ++++ tob 2004-03-21 13:25:02.000000000 -0500 +@@ -347,7 +347,8 @@ + #fi + # 'findswitch' also removed from the paragraph after next + +- $nicefindcmd find `cat $TOBHOME/volumes/$1.startdir` $xdevflag -printf '%p'$S'[ctime:] %C@ [owner/group:] %u:%g' \( \( -fstype fat -or -fstype vfat \) -and -printf ' [mtime:] %T@' -or -printf ' [inode:] %i' \) -printf ' [linkto:] %l [perm:] %m [hardlinks:] %n\n' | \ ++ cat $TOBHOME/volumes/$1.startdir | \ ++ xargs -i $nicefindcmd find {} $xdevflag -printf '%p'$S'[ctime:] %C@ [owner/group:] %u:%g' \( \( -fstype fat -or -fstype vfat \) -and -printf ' [mtime:] %T@' -or -printf ' [inode:] %i' \) -printf ' [linkto:] %l [perm:] %m [hardlinks:] %n\n' | \ + sed -e 's.\\.\\\\.g' | \ + # If the exclude file contains non-blank lines, filter against it. + # If it is empty, or doesn't exist, just cat stdin to stdout +@@ -356,7 +357,7 @@ + else + cat + fi | +- sort > $TMPLIST || \ ++ sort -u > $TMPLIST || \ + error "list creation failed." + + grep -q . $TMPLIST || --- tob-0.26.cvs.20040226.orig/debian/bug227009_tob.rc_Dan.patch +++ tob-0.26.cvs.20040226/debian/bug227009_tob.rc_Dan.patch @@ -0,0 +1,105 @@ +--- tob.rc.dpkg-dist 2004-02-26 21:42:28.000000000 -0500 ++++ tob.rc.default 2004-03-06 20:01:39.000000000 -0500 +@@ -15,21 +15,43 @@ + # Debian stores tob configuration in and below this directory + TOBHOME="/etc/tob" + +-# Examples for possible backup devices selected via BACKUPDEV +-# +-# /dev/ftape should be a link to your the device corresponding to your tape ++# Examples for possible backup devices selected via BACKUPDEV: ++# ++# 1) A device, for example + # + # BACKUPDEV="/dev/ftape" +-# +-# or use the tape drive on another networked box 'groucho.my.net' ++# ++# where /dev/ftape should be a link to your the device corresponding ++# to your tape. ++# ++# Or use the tape drive on another networked box 'groucho.my.net': ++# + # BACKUPDEV="groucho.my.net:/dev/ftape" + # +-# or use a filesystem-based backup: +-BACKUPDEV="/var/backups/" +- +-# If you're using a filesystem backup, tob will clean out old backups +-# for you once they reach a certain age. Set that age (in days) here: +-MAXBACKUPAGE=5 ++# 2) A directory, for example: ++# ++# BACKUPDEV="/var/lib/tob" ++# ++# In this case, tob chooses the file name to use. This is the default. ++# ++# 3) A file, for example: ++# ++# if [ ! "$TYPE" == "none" ]; then ++# TODAYIS=`date +%y%m%d` ++# MYBACKUPDIR="/Backups/${HOSTNAME}/${TODAYIS}-${TYPE}" ++# BACKUPDEV="${MYBACKUPDIR}/${TODAYIS}-${TYPE}-${VOLUMENAME}.tar.gz" ++# mkdir -p ${MYBACKUPDIR} ++# fi ++# ++# BACKUPDEV can be overridden by specifying "-f path" on the tob ++# command line. ++ ++# If you're using a filesystem backup, tob can delete old backups ++# in the directory containing the new backup. It will only delete ++# backups that aren't needed for a full restore, and which are ++# at least MAXBACKUPAGE days old. If MAXBACKUPAGE is negative, ++# no old backups are deleted. ++MAXBACKUPAGE=-1 + + # PRECMD and POSTCMD are not needed for loading/unloading of the ftape + # modules if the following two lines are added to /etc/conf.modules so that +@@ -47,9 +69,23 @@ + # + # I use the following command to retension the tape before I backup: + # PRECMD='ftmt -f $BACKUPDEV retension 2>/dev/null; echo Tape retensioned' +-#DELETIONSCOMMAND='cat >$BACKUPDIR/${VOLUMENAME}_${DATE}_${TYPE}_deletions' +-# Debian bug report #233300 suggests +-DELETIONSCOMMAND='cat >${TOBLISTS}/${VOLUMENAME}_${DATE}_${TYPE}_deletions' ++ ++# A list of all files that have been deleted will be piped to ++# the following command. This information is necessary after ++# a differential or incremental backup if you want to restore ++# the filesystem to the same state it is in. Thus this data ++# should be saved along with your backups. If unset, no ++# deletion list is saved. Examples: ++# ++# If $BACKUPDEV is a directory: ++# ++DELETIONSCOMMAND='cat >${BACKUPDEV}/${VOLUMENAME}_${DATE}_${TYPE}_deletions' ++# ++# If $BACKUPDEV is a device: ++# ++# DELETIONSCOMMAND='cat >${BACKUPDEV}' ++# ++# In either case, "cat" could be replaced with "gzip". + + # let tob be explicit + VERBOSE='yes' +@@ -69,8 +105,10 @@ + GZIPFACTOR='-G 9 -Z ' + + # These commands select afio as the backup engine with the selected +-# compression and block sizes, more examples for tob and afio use are +-# provided in /usr/doc/tob/examples ++# compression and block sizes. More examples for tob and afio use are ++# provided in /usr/doc/tob/examples. Note that if BACKUPDEV is set ++# to a directory, tob will reset it to a filename before calling ++# these commands. + BACKUPCMD='afio $BLOCKSIZE $BUFFERBLK $GZIPFACTOR -o $BACKUPDEV < $FILELIST' + BACKUPCMDTOSTDOUT='afio $BLOCKSIZE $BUFFERBLK $GZIPFACTOR -o - < $FILELIST' + LISTCMD='afio $BLOCKSIZE $BUFFERBLK -t $BACKUPDEV' +@@ -81,7 +119,3 @@ + # Note: if you change this, you might have to mop up backups with the old + # extension yourself. + EXT=gz +- +- +- +- --- tob-0.26.cvs.20040226.orig/debian/bug227009_tob_Dan.patch +++ tob-0.26.cvs.20040226/debian/bug227009_tob_Dan.patch @@ -0,0 +1,108 @@ +--- tob.orig.3 2004-02-26 22:03:46.000000000 -0500 ++++ tob 2004-03-06 20:21:52.000000000 -0500 +@@ -197,7 +197,7 @@ + + if [ "$NEEDROOT" = "yes" ] ; then + if [ $UID -ne 0 ]; then +- error "You need to be root to run tobs!" ++ error "You need to be root to run tob!" + fi + fi + } +@@ -218,14 +218,9 @@ + error "BACKUPDIR is deprecated: check your config file, and rename it to BACKUPDEV" + fi + +- if [ -d "$BACKUPDEV" ]; then +- BACKUPDIR=$BACKUPDEV +- BACKUPDEV="${BACKUPDIR}/${VOLUMENAME}_${DATE}_${TYPE}.${EXT}" +- elif [ "$BACKUPDEV" = "" ]; then +- BACKUPDIR="/var/lib/tob" +- BACKUPDEV="${BACKUPDIR}/${VOLUMENAME}_${DATE}_${TYPE}.${EXT}" +- elif [ -f "$BACKUPDEV" -o ! -e "$BACKUPDEV" ]; then +- BACKUPDIR=`dirname $BACKUPDEV` ++ if [ "$BACKUPDEV" = "" ]; then ++ BACKUPDEV="/var/lib/tob" ++ message "Using default backup device $BACKUPDEV" + fi + + # check that relevant environment vars are set +@@ -497,8 +492,8 @@ + runverify () + { + VOLUMENAME=$2 # store name for usage in .rc file +- if [ -d "$BACKUPDIR" ]; then +- BACKUPDEV=`$LS ${BACKUPDIR}/${VOLUMENAME}_*Full.${EXT}` ++ if [ -d "$BACKUPDEV" ]; then ++ BACKUPDEV=`$LS ${BACKUPDEV}/${VOLUMENAME}_*full.${EXT}` + fi + message "Now starting verify program for $BACKUPDEV." + ( cd /; +@@ -512,6 +507,9 @@ + runbackup () + { + VOLUMENAME=$2 # store name for usage in .rc file ++ if [ -d "$BACKUPDEV" ]; then ++ BACKUPDEV="${BACKUPDEV}/${VOLUMENAME}_${DATE}_${TYPE}.${EXT}" ++ fi + + message "Now starting backup program to write to $BACKUPDEV." + sed -e 's.\\\\.\\.g' -e "$SEDNAMESCRIPT" < "$1" > $FILELIST +@@ -553,9 +551,9 @@ + exclude=$base.exclude + + echo "Volume \"$base\"" +- message " starts: " `cat $f` ++ echo " starts: " `cat $f` + if [ -f $exclude ] ; then +- message " excludes: " `cat $exclude` ++ echo " excludes: " `cat $exclude` + fi + done + } +@@ -576,10 +574,12 @@ + + deleteoldbackups () + { +- if [ -d "$BACKUPDIR" -a "$MAXBACKUPAGE" -ge 0 ]; then ++ # Since runbackups has run, $BACKUPDEV is either a file or a device. ++ # We only do deletions when it is a file. ++ if [ "$MAXBACKUPAGE" -ge 0 -a -f "$BACKUPDEV" ]; then + UPTO=`basename $BACKUPDEV` +- cd $BACKUPDIR +- message "Deleting old backups:" ++ cd `dirname $BACKUPDEV` ++ message "Deleting old backups from `dirname $BACKUPDEV`:" + PR=""; [ "$VERBOSE" == "yes" ] && PR="-print" + find . -regex ./${VOLUMENAME}_'.*\('$1'\).*' -type f -maxdepth 1 -mtime +$MAXBACKUPAGE ! -name "$UPTO" -exec $RM -f {} \; $PR + fi +@@ -691,15 +691,13 @@ + # generate listing of stuff on backup device + verbose () + { +- +- if [ -d "$BACKUPDIR" ]; then +- message "Generating report of $BACKUPDIR." +- for i in `$LS ${BACKUPDIR}/*`; do ++ message "Generating report of $BACKUPDEV." ++ if [ -d "$BACKUPDEV" ]; then ++ for i in `$LS ${BACKUPDEV}/*.${EXT}`; do + BACKUPDEV=$i + eval "$LISTCMD" + done + else +- message "Generating report of $BACKUPDEV." + eval "$LISTCMD" || error "listing of $BACKUPDEV cannot be generated." + fi + } +@@ -718,8 +716,8 @@ + FILESPEC=$3 + message "Restoring volume $VOLUMENAME files matching $FILESPEC into $startdir." + +- if [ -d "$BACKUPDIR" ]; then +- for i in `$LS ${BACKUPDIR}/${VOLUMENAME}_*.${EXT}`; do ++ if [ -d "$BACKUPDEV" ]; then ++ for i in `$LS ${BACKUPDEV}/${VOLUMENAME}_*.${EXT}`; do + BACKUPDEV=$i + eval "$RESTORECMD" && message "restored data from $i" + done --- tob-0.26.cvs.20040226.orig/debian/changelog +++ tob-0.26.cvs.20040226/debian/changelog @@ -1,3 +1,82 @@ +tob (0.26.cvs.20040226-7ubuntu0~ppa3) xenial; urgency=medium + + * Fix signal 13/broken pipe when a grep encounters an unexpected binary in filenames + + -- Dominik Stadler (Ubuntu key) Sun, 13 Nov 2016 20:32:09 +0100 + +tob (0.26.cvs.20040226-7ubuntu0~ppa2) xenial; urgency=medium + + * Upload to Xenial. + + -- Dominik Stadler (Ubuntu key) Sun, 07 Aug 2016 02:11:21 +0200 + +tob (0.26.cvs.20040226-7ubuntu0~ppa1) trusty; urgency=medium + + * Upload to trusty as I still use this tool for backups. + + -- Dominik Stadler (Ubuntu key) Thu, 26 Jun 2014 22:44:09 +0200 + +tob (0.26.cvs.20040226-7) unstable; urgency=low + + * tob: Remove '-maxdepth 1' from find call in deleteoldbackups() + function as it triggers a noisy warning from find. + (Closes: #584490) + + * tob.8: Minor formatting change suggested by Lintian warning + + * debian/control: Set Standards-Version: to current version + * debian/control: Updated Builds-Depends: on debhelper + * debian/control: Added Depends: on ${misc:Depends} + * debian/source/format: Added pointless format specification + + -- Dirk Eddelbuettel Sat, 05 Jun 2010 09:48:39 -0500 + +tob (0.26.cvs.20040226-6) unstable; urgency=low + + * tob: Apply patch by Fabio Muzzi that correct 'tob -fullcount' on + systems with the en-US.UTF-8 locale (Closes: #419232) + + * debian/control: Add debhelper to Build-Depends: [lintian] + * debian/control: Updated Build-Depends: on debhelper (>= 5.0.0) + * debian/control: Updated Standards-Version: to 3.7.2 [lintian] + * debian/compat: Added with value 5 [lintian] + * debian/rules: Update package temp. directory accordingly + * debian/conffiles: Removed as no longer needed + * debian/copyright: Updated FSF address [lintian] + * debian/rules: Call pod2man with '--section 8' to get tobconv.8 into + the right section [lintian] + + -- Dirk Eddelbuettel Sun, 22 Apr 2007 11:20:43 -0500 + +tob (0.26.cvs.20040226-5) unstable; urgency=low + + * tob: Apply patch by Dan Christensen that should have gotten in earlier + + -- Dirk Eddelbuettel Sun, 21 Mar 2004 15:36:20 -0600 + +tob (0.26.cvs.20040226-4) unstable; urgency=low + + * tob: Now really apply the patch + + -- Dirk Eddelbuettel Wed, 10 Mar 2004 22:28:39 -0600 + +tob (0.26.cvs.20040226-3) unstable; urgency=low + + * tob: Applied one-char patch by Michael Schuerig to sort backups displayed + by '-backups' command in descending date order (Closes: #237331) + + -- Dirk Eddelbuettel Wed, 10 Mar 2004 21:41:19 -0600 + +tob (0.26.cvs.20040226-2) unstable; urgency=low + + * tob: Applied patch by Dan Christensen which cleans the BACKUPDEV + vs BACKUPDIR issues in tob and tob.rc. Many thanks to Dan, please see + the log for bug report #227009 for fuller description (Closes: #227009) + * tob: Applied another patch suggestion by Dan to deal with -verify + in case several full backups are encountered in BACKUPDEV. + + -- Dirk Eddelbuettel Mon, 8 Mar 2004 20:45:42 -0600 + tob (0.26.cvs.20040226-1) unstable; urgency=low * New upstream CVS checkout plus application of the patches from BTS @@ -5,7 +84,7 @@ - Improved deletion of old backups (Closes: #231118) - No good way to change backup file name (Closes: #231121) - -- Dirk Eddelbuettel Thu, 26 Feb 2004 21:01:36 -0600 + -- Dirk Eddelbuettel Thu, 26 Feb 2004 21:04:49 -0600 tob (0.26.cvs.20040201-1) unstable; urgency=low @@ -211,33 +290,33 @@ -- Dirk Eddelbuettel Fri, 5 Mar 1999 22:42:53 -0500 -tob (0.14-15) unstable; urgency=low, Closes=33546 +tob (0.14-15) unstable; urgency=low * tob: Use SEDNAMESCRIPT in runverify(). Thanks to - stalex@physlab.sci.ccny.cuny.edu for the patch. (fixes #33546) + stalex@physlab.sci.ccny.cuny.edu for the patch. (Closes: #33546) - -- Dirk Eddelbuettel Sun, 21 Feb 1999 20:21:48 -0500 + -- Dirk Eddelbuettel Sun, 21 Feb 1999 20:21:48 -0500 -tob (0.14-14) unstable; urgency=low, Closes=31037 +tob (0.14-14) unstable; urgency=low * tob: Added (modified) patch by Richard Hawes for a '-f altdev' option to specify an alternative backup - device. (fixes #31037) + device. (Closes: #31037) * tob.8: Changed manual page accordingly -- Dirk Eddelbuettel Sat, 9 Jan 1999 10:18:16 -0500 -tob (0.14-13) unstable; urgency=low, Closes=29606 +tob (0.14-13) unstable; urgency=low - * tob: Changed to use .gz suffix instead of .z (fixes #29606) + * tob: Changed to use .gz suffix instead of .z (Closes: #29606) * postinst: Added code to rename old listings to .gz suffix -- Dirk Eddelbuettel Wed, 25 Nov 1998 20:47:15 -0500 -tob (0.14-12) frozen unstable; urgency=low, Closes=29314 +tob (0.14-12) frozen unstable; urgency=low * Applied patch to tob.8 by Jim Van Zandt which - corrects some wording, some formating and one factual error (fixes #29314) + corrects some wording, some formating and one factual error (Closes: #29314) * Added a contribution by Frank Miles (and further modified it) to add a new option '-verify ' to check an archive written with afio @@ -272,10 +351,10 @@ -- Dirk Eddelbuettel Sun, 17 May 1998 16:52:30 -0400 -tob (0.14-8) frozen unstable; urgency=low, Closes=22462 +tob (0.14-8) frozen unstable; urgency=low * Changed /sbin/tob to use tempfile(1) and test its result and - removed the tempfile call from /etc/tob.rc (fixes #22462) + removed the tempfile call from /etc/tob.rc (Closes: #22462) * Removed the 'set -e' from /sbin/tob as we're now testing tempfile * Updated the configuration file /etc/tob.rc and added more comments * Modified /sbin/tob following a suggestion by Alexander Shumakovitch @@ -285,23 +364,23 @@ -- Dirk Eddelbuettel Sat, 16 May 1998 19:01:04 -0400 -tob (0.14-7) frozen unstable; urgency=low, Closes=21412 +tob (0.14-7) frozen unstable; urgency=low * Changed /sbin/tob to not use 'set -e' in a small segment of code where - a grep(1) might evaluate to false causing tob to abort. + a grep(1) might evaluate to false causing tob to abort. (Closes: #21412) -- Dirk Eddelbuettel Fri, 24 Apr 1998 18:51:44 -0400 -tob (0.14-6) frozen unstable; urgency=low, Closes=21412 +tob (0.14-6) frozen unstable; urgency=low - * Added dependency on debianutils as tob uses tempfile (fixes #21412) - * Added 'set -e' to force tob to abort on error (fixes #21412) + * Added dependency on debianutils as tob uses tempfile (Closes: #21412) + * Added 'set -e' to force tob to abort on error (Closes: #21412) -- Dirk Eddelbuettel Wed, 22 Apr 1998 21:55:37 -0400 -tob (0.14-5) unstable; urgency=low, Closes=21412 +tob (0.14-5) unstable; urgency=low - * Add a test clause before file removal (fixes #21412) + * Add a test clause before file removal (Closes: #21412) -- Dirk Eddelbuettel Mon, 20 Apr 1998 21:52:40 -0400 --- tob-0.26.cvs.20040226.orig/debian/compat +++ tob-0.26.cvs.20040226/debian/compat @@ -0,0 +1 @@ +5 --- tob-0.26.cvs.20040226.orig/debian/control +++ tob-0.26.cvs.20040226/debian/control @@ -2,12 +2,12 @@ Section: utils Priority: optional Maintainer: Dirk Eddelbuettel -Standards-Version: 3.6.1.0 -Build-Depends-Indep: debhelper (>= 3.0.0) +Standards-Version: 3.8.4 +Build-Depends: debhelper (>= 7.0.0) Package: tob Architecture: all -Depends: debianutils (>= 1.6), afio, perl +Depends: ${misc:Depends}, debianutils (>= 1.6), afio, perl Description: Small yet powerful program for tape oriented backups tob is a simple yet configurable shell-script which, given a set of `volume definitions', runs tar or afio based backups, either for use --- tob-0.26.cvs.20040226.orig/debian/copyright +++ tob-0.26.cvs.20040226/debian/copyright @@ -26,14 +26,14 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. On Debian Linux systems, the complete text of the GNU General Public -License can be found in `/usr/share/common-licenses/GPL'. +License can be found in `/usr/share/common-licenses/GPL-2'. The modifications for Debian (the addition of the debian.* files and the changes to the original source code) are - Copyright (C) 1995-2002 Dirk Eddelbuettel + Copyright (C) 1995-2007 Dirk Eddelbuettel and are also released under the GNU General Public License. --- tob-0.26.cvs.20040226.orig/debian/dan_abort_backupdev.patch +++ tob-0.26.cvs.20040226/debian/dan_abort_backupdev.patch @@ -0,0 +1,12 @@ +--- tob 2004-03-06 20:21:52.000000000 -0500 ++++ tob.abort 2004-03-07 21:28:21.000000000 -0500 +@@ -493,7 +493,8 @@ + { + VOLUMENAME=$2 # store name for usage in .rc file + if [ -d "$BACKUPDEV" ]; then +- BACKUPDEV=`$LS ${BACKUPDEV}/${VOLUMENAME}_*full.${EXT}` ++ echo "BACKUPDEV is set to a directory: $BACKUPDEV" ++ error "Use -f to specify a file or device to verify." + fi + message "Now starting verify program for $BACKUPDEV." + ( cd /; --- tob-0.26.cvs.20040226.orig/debian/dan_iterate_backupdev.patch +++ tob-0.26.cvs.20040226/debian/dan_iterate_backupdev.patch @@ -0,0 +1,23 @@ +--- tob 2004-03-06 20:21:52.000000000 -0500 ++++ tob.iterate 2004-03-07 21:26:17.000000000 -0500 +@@ -493,12 +493,15 @@ + { + VOLUMENAME=$2 # store name for usage in .rc file + if [ -d "$BACKUPDEV" ]; then +- BACKUPDEV=`$LS ${BACKUPDEV}/${VOLUMENAME}_*full.${EXT}` ++ for i in `$LS ${BACKUPDEV}/${VOLUMENAME}_*full.${EXT}`; do ++ BACKUPDEV=$i ++ message "Now starting verify program for $BACKUPDEV." ++ (cd /; eval "$VERIFYCMD") ++ done ++ else ++ message "Now starting verify program for $BACKUPDEV." ++ (cd /; eval "$VERIFYCMD") + fi +- message "Now starting verify program for $BACKUPDEV." +- ( cd /; +- eval "$VERIFYCMD" +- ) + } + + ############################################################################ --- tob-0.26.cvs.20040226.orig/debian/rules +++ tob-0.26.cvs.20040226/debian/rules @@ -1,10 +1,10 @@ #!/usr/bin/make -f # -*- makefile -*- # debian/rules file for the Debian/GNU Linux tob package -# Copyright 1996-2003 by Dirk Eddelbuettel +# Copyright 1996-2007 by Dirk Eddelbuettel package = tob -debdir := $(shell pwd)/debian/tmp +debdir := $(shell pwd)/debian/$(package) # export DH_VERBOSE=1 @@ -24,9 +24,11 @@ clean: dh_testdir dh_testroot - rm -f build-stamp + rm -f build-stamp #-$(MAKE) clean dh_clean + ## no longer needed but creeps around + rm -vf debian/conffiles binary-indep: build dh_testdir @@ -52,7 +54,8 @@ #dh_installinit #dh_installcron dh_installman tob.8 - pod2man contrib/tobconv $(debdir)/usr/share/man/man8/tobconv.8 + pod2man --section 8 \ + contrib/tobconv $(debdir)/usr/share/man/man8/tobconv.8 #dh_undocumented dh_installchangelogs dh_strip --- tob-0.26.cvs.20040226.orig/debian/source/format +++ tob-0.26.cvs.20040226/debian/source/format @@ -0,0 +1 @@ +1.0 --- tob-0.26.cvs.20040226.orig/tob +++ tob-0.26.cvs.20040226/tob @@ -197,7 +197,7 @@ if [ "$NEEDROOT" = "yes" ] ; then if [ $UID -ne 0 ]; then - error "You need to be root to run tobs!" + error "You need to be root to run tob!" fi fi } @@ -218,14 +218,9 @@ error "BACKUPDIR is deprecated: check your config file, and rename it to BACKUPDEV" fi - if [ -d "$BACKUPDEV" ]; then - BACKUPDIR=$BACKUPDEV - BACKUPDEV="${BACKUPDIR}/${VOLUMENAME}_${DATE}_${TYPE}.${EXT}" - elif [ "$BACKUPDEV" = "" ]; then - BACKUPDIR="/var/lib/tob" - BACKUPDEV="${BACKUPDIR}/${VOLUMENAME}_${DATE}_${TYPE}.${EXT}" - elif [ -f "$BACKUPDEV" -o ! -e "$BACKUPDEV" ]; then - BACKUPDIR=`dirname $BACKUPDEV` + if [ "$BACKUPDEV" = "" ]; then + BACKUPDEV="/var/lib/tob" + message "Using default backup device $BACKUPDEV" fi # check that relevant environment vars are set @@ -352,16 +347,17 @@ #fi # 'findswitch' also removed from the paragraph after next - $nicefindcmd find `cat $TOBHOME/volumes/$1.startdir` $xdevflag -printf '%p'$S'[ctime:] %C@ [owner/group:] %u:%g' \( \( -fstype fat -or -fstype vfat \) -and -printf ' [mtime:] %T@' -or -printf ' [inode:] %i' \) -printf ' [linkto:] %l [perm:] %m [hardlinks:] %n\n' | \ + cat $TOBHOME/volumes/$1.startdir | \ + xargs -i $nicefindcmd find {} $xdevflag -printf '%p'$S'[ctime:] %C@ [owner/group:] %u:%g' \( \( -fstype fat -or -fstype vfat \) -and -printf ' [mtime:] %T@' -or -printf ' [inode:] %i' \) -printf ' [linkto:] %l [perm:] %m [hardlinks:] %n\n' | \ sed -e 's.\\.\\\\.g' | \ # If the exclude file contains non-blank lines, filter against it. # If it is empty, or doesn't exist, just cat stdin to stdout if grep -q -s . $TOBHOME/volumes/$1.exclude ; then - grep -v -f$TOBHOME/volumes/$1.exclude + grep -v -f$TOBHOME/volumes/$1.exclude --binary-files=text else cat fi | - sort > $TMPLIST || \ + sort -u > $TMPLIST || \ error "list creation failed." grep -q . $TMPLIST || @@ -440,7 +436,7 @@ searchlistings () { cd $TOBLISTS || error "$TOBLISTS directory is missing." - files=`$LS -1 | $GREP -v _deletions$` + files=`$LS -1t | $GREP -v _deletions$` if [ "$files" = "" ] ; then message "No backups were made." @@ -477,14 +473,14 @@ else sed -e 's.\\\\.\\.g' -e "$SEDNAMESCRIPT" < "$1" > $FILELIST eval "$BACKUPCMDTOSTDOUT" | - wc | - awk '{ if ($3 < 1000) - printf ("Estimated: %d bytes\n",$3); - else if ($3 < 1000000) - printf ("Estimated: %.1f KB\n",$3/1000.0); - else - printf ("Estimated: %.1f MB\n",$3/1000000.0); }' \ - || error "backup size estimate failed." + wc -c | + awk '{ if ($1 < 1000) + printf ("Estimated: %d bytes\n",$1); + else if ($1 < 1000000) + printf ("Estimated: %.1f KB\n",$1/1000.0); + else + printf ("Estimated: %.1f MB\n",$1/1000000.0); }' \ + || error "backup size estimate failed." fi } @@ -497,9 +493,14 @@ runverify () { VOLUMENAME=$2 # store name for usage in .rc file - if [ -d "$BACKUPDIR" ]; then - BACKUPDEV=`$LS ${BACKUPDIR}/${VOLUMENAME}_*Full.${EXT}` + + if [ -d "$BACKUPDEV" ]; then + BACKUPDEV=(`$LS ${BACKUPDEV}/${VOLUMENAME}_*full.${EXT}`) + if [ ${#BACKUPDEV[*]} -ne 1 ]; then + error "More than one full backup to choose from. Use -f to select one." + fi fi + message "Now starting verify program for $BACKUPDEV." ( cd /; eval "$VERIFYCMD" @@ -512,6 +513,9 @@ runbackup () { VOLUMENAME=$2 # store name for usage in .rc file + if [ -d "$BACKUPDEV" ]; then + BACKUPDEV="${BACKUPDEV}/${VOLUMENAME}_${DATE}_${TYPE}.${EXT}" + fi message "Now starting backup program to write to $BACKUPDEV." sed -e 's.\\\\.\\.g' -e "$SEDNAMESCRIPT" < "$1" > $FILELIST @@ -553,9 +557,9 @@ exclude=$base.exclude echo "Volume \"$base\"" - message " starts: " `cat $f` + echo " starts: " `cat $f` if [ -f $exclude ] ; then - message " excludes: " `cat $exclude` + echo " excludes: " `cat $exclude` fi done } @@ -576,12 +580,14 @@ deleteoldbackups () { - if [ -d "$BACKUPDIR" -a "$MAXBACKUPAGE" -ge 0 ]; then + # Since runbackups has run, $BACKUPDEV is either a file or a device. + # We only do deletions when it is a file. + if [ "$MAXBACKUPAGE" -ge 0 -a -f "$BACKUPDEV" ]; then UPTO=`basename $BACKUPDEV` - cd $BACKUPDIR - message "Deleting old backups:" + cd `dirname $BACKUPDEV` + message "Deleting old backups from `dirname $BACKUPDEV`:" PR=""; [ "$VERBOSE" == "yes" ] && PR="-print" - find . -regex ./${VOLUMENAME}_'.*\('$1'\).*' -type f -maxdepth 1 -mtime +$MAXBACKUPAGE ! -name "$UPTO" -exec $RM -f {} \; $PR + find . -regex ./${VOLUMENAME}_'.*\('$1'\).*' -type f -mtime +$MAXBACKUPAGE ! -name "$UPTO" -exec $RM -f {} \; $PR fi } @@ -691,15 +697,13 @@ # generate listing of stuff on backup device verbose () { - - if [ -d "$BACKUPDIR" ]; then - message "Generating report of $BACKUPDIR." - for i in `$LS ${BACKUPDIR}/*`; do + message "Generating report of $BACKUPDEV." + if [ -d "$BACKUPDEV" ]; then + for i in `$LS ${BACKUPDEV}/*.${EXT}`; do BACKUPDEV=$i eval "$LISTCMD" done else - message "Generating report of $BACKUPDEV." eval "$LISTCMD" || error "listing of $BACKUPDEV cannot be generated." fi } @@ -718,8 +722,8 @@ FILESPEC=$3 message "Restoring volume $VOLUMENAME files matching $FILESPEC into $startdir." - if [ -d "$BACKUPDIR" ]; then - for i in `$LS ${BACKUPDIR}/${VOLUMENAME}_*.${EXT}`; do + if [ -d "$BACKUPDEV" ]; then + for i in `$LS ${BACKUPDEV}/${VOLUMENAME}_*.${EXT}`; do BACKUPDEV=$i eval "$RESTORECMD" && message "restored data from $i" done --- tob-0.26.cvs.20040226.orig/tob.8 +++ tob-0.26.cvs.20040226/tob.8 @@ -1,10 +1,10 @@ -T.\" Manual page Copyright (C) 1995-98 Dirk Eddelbuettel +.\" Manual page Copyright (C) 1995-98 Dirk Eddelbuettel .\" 1998-11-11 Jim Van Zandt : -restore takes .\" both specification and directory arguments, the specification .\" is *not* a regular expression, and wording and format fixes. .\" 15 Nov 1998 Dirk Eddelbuettel .\" documented new option '-verify volume' -.TH TOB 8 "September 15, 2002" "Debian GNU/Linux" +.TH TOB 8 "September 15, 2002" .SH NAME tob \- Tape Oriented Backup .SH SYNOPSIS @@ -114,14 +114,14 @@ .B "\-find" command is useful to determine in which backup a given file resides. E.g., the command -.ce -tob \-find '.*in' -.cd 0 +.br + tob \-find '.*in' +.br lists all files ending with "in". The files can then be restored from the reported backup. The command -.ce -tob \-find . -.cd 0 +.br + tob \-find . +.br will list all files of all volumes. .TP .BI "\-full " volume @@ -179,9 +179,9 @@ will restore any files which start with "/etc/def". Wildcards may have to be quoted to prevent shell expansion, as in: -.ce -tob \-restore '/etc/def*' -.cd 0 +.br + tob \-restore '/etc/def*' +.br .\"The file specification is actually a regular expression; this means that you You can, e.g., restore all files which end in "myfile" with the expression .IR "*myfile" ; --- tob-0.26.cvs.20040226.orig/tob.rc +++ tob-0.26.cvs.20040226/tob.rc @@ -15,21 +15,43 @@ # Debian stores tob configuration in and below this directory TOBHOME="/etc/tob" -# Examples for possible backup devices selected via BACKUPDEV -# -# /dev/ftape should be a link to your the device corresponding to your tape +# Examples for possible backup devices selected via BACKUPDEV: +# +# 1) A device, for example # # BACKUPDEV="/dev/ftape" -# -# or use the tape drive on another networked box 'groucho.my.net' +# +# where /dev/ftape should be a link to your the device corresponding +# to your tape. +# +# Or use the tape drive on another networked box 'groucho.my.net': +# # BACKUPDEV="groucho.my.net:/dev/ftape" # -# or use a filesystem-based backup: -BACKUPDEV="/var/backups/" - -# If you're using a filesystem backup, tob will clean out old backups -# for you once they reach a certain age. Set that age (in days) here: -MAXBACKUPAGE=5 +# 2) A directory, for example: +# +# BACKUPDEV="/var/lib/tob" +# +# In this case, tob chooses the file name to use. This is the default. +# +# 3) A file, for example: +# +# if [ ! "$TYPE" == "none" ]; then +# TODAYIS=`date +%y%m%d` +# MYBACKUPDIR="/Backups/${HOSTNAME}/${TODAYIS}-${TYPE}" +# BACKUPDEV="${MYBACKUPDIR}/${TODAYIS}-${TYPE}-${VOLUMENAME}.tar.gz" +# mkdir -p ${MYBACKUPDIR} +# fi +# +# BACKUPDEV can be overridden by specifying "-f path" on the tob +# command line. + +# If you're using a filesystem backup, tob can delete old backups +# in the directory containing the new backup. It will only delete +# backups that aren't needed for a full restore, and which are +# at least MAXBACKUPAGE days old. If MAXBACKUPAGE is negative, +# no old backups are deleted. +MAXBACKUPAGE=-1 # PRECMD and POSTCMD are not needed for loading/unloading of the ftape # modules if the following two lines are added to /etc/conf.modules so that @@ -47,9 +69,23 @@ # # I use the following command to retension the tape before I backup: # PRECMD='ftmt -f $BACKUPDEV retension 2>/dev/null; echo Tape retensioned' -#DELETIONSCOMMAND='cat >$BACKUPDIR/${VOLUMENAME}_${DATE}_${TYPE}_deletions' -# Debian bug report #233300 suggests -DELETIONSCOMMAND='cat >${TOBLISTS}/${VOLUMENAME}_${DATE}_${TYPE}_deletions' + +# A list of all files that have been deleted will be piped to +# the following command. This information is necessary after +# a differential or incremental backup if you want to restore +# the filesystem to the same state it is in. Thus this data +# should be saved along with your backups. If unset, no +# deletion list is saved. Examples: +# +# If $BACKUPDEV is a directory: +# +DELETIONSCOMMAND='cat >${BACKUPDEV}/${VOLUMENAME}_${DATE}_${TYPE}_deletions' +# +# If $BACKUPDEV is a device: +# +# DELETIONSCOMMAND='cat >${BACKUPDEV}' +# +# In either case, "cat" could be replaced with "gzip". # let tob be explicit VERBOSE='yes' @@ -69,8 +105,10 @@ GZIPFACTOR='-G 9 -Z ' # These commands select afio as the backup engine with the selected -# compression and block sizes, more examples for tob and afio use are -# provided in /usr/doc/tob/examples +# compression and block sizes. More examples for tob and afio use are +# provided in /usr/doc/tob/examples. Note that if BACKUPDEV is set +# to a directory, tob will reset it to a filename before calling +# these commands. BACKUPCMD='afio $BLOCKSIZE $BUFFERBLK $GZIPFACTOR -o $BACKUPDEV < $FILELIST' BACKUPCMDTOSTDOUT='afio $BLOCKSIZE $BUFFERBLK $GZIPFACTOR -o - < $FILELIST' LISTCMD='afio $BLOCKSIZE $BUFFERBLK -t $BACKUPDEV' @@ -81,7 +119,3 @@ # Note: if you change this, you might have to mop up backups with the old # extension yourself. EXT=gz - - - -