**NAME** tbku - Table-driven backup script **SYNOPSIS** ``tbku allsets | [fileset] ...`` **DESCRIPTION** ``tbku`` is a utility script for producing "tarball" backups of some- or all of your file systems. It is useful both for producing incremental backups and for systemwide images or "snapshots". The script can be run either from the command line or, more typically, as a ``cron`` job to automate system backup tasks. ``tbku`` was originally developed as a backup tool for FreeBSD systems. Since then, it has been updated to also work with SUSE Linux. ``tbku`` should work with little- or no modification on any other Unix-like system. **HOW tbku WORKS** This program produces tarballs of backup "sets". The tarball is written to $BKUDIR. By default, this is '/bku' but you can override this with the $TBKUDIR environment variable to point to any directory you wish. If the directory does not exist, 'tbku' will create it for you when it runs. A backup "set" consists of a related set of files and directories that are all to be backed up together into a single tarball. The file containing all the names of all the files and directories in a given backup set is called the "fileset". 'tbku' expects to find filesets in $FILESETDIR. By default, this is '/root/tbku', but you can override this by setting the $TBKUSETS environment variable to point to the directory of your choice. Notice that if this directory does not exist OR if the fileset you name does not actually exist, 'tbku' will appear to run, but will produce an empty backup set with an error in it's log indicating that it could not find the named fileset. A backup that fails for this reason will also be flagged by having the "*" character in its backup, log, and timestamp filenames. The naming of filesets is important. Fileset names must end in ".backup name". If the name begins with $COMMON, then this program understands that set to be done "automatically". That is, if nothing is passed on the command line, the program does an "automatic" backup - i.e., It processess ALL the filesets found in the backup directory whose names begin with $COMMON. The program can also be started with command line arguments. It understands these to be the name of the backups desired. For instance: tbku foo bar baz Will look for filesets ending in ".foo", ".bar", ".baz". In this case, the program does not care what the beginning of the fileset name is. This can potentially be a problem if you have two filesets whose names end identically. Say you have 'manual.bku.foo' and "auto.bku.foo" in your $FILESETDIR directory and you issue the command "tbku foo". BOTH of these filesets will be processed since they both have the backup name "foo". The last one to be processes will be the one whose backup tarball ends in $BKUDIR. The simple way to avoid this is to never name two filesets with the same ending backup name. Do NOT use the special setname ".allsets". This name is reserved. When passed on the command line ("tbku allsets"), it does all of the backup sets it finds regardless of whether they are set for automatic or not. If the setname is "tape", then output will be written to the device or file specified in the $TAPEDEV variable instead of a file in the backup directory. **CUSTOMIZING tbku** ``tbku`` is written to be "smart" enough to figure out where your system keeps needed tools like ``tar`` or ``sed``. The only requirement here is that ``tbku`` be run in an environment that can find the ``which`` command somewhere in its ``$PATH`` - ``tbku`` uses ``which`` to figure out just where everything it needs lives on your filesystem. If ``tbku`` cannot figure out where your system keeps things, it will use the FreeBSD default values. For most FreeBSD and Linux users, this should work without any customization beyond setting environment variables to override default behavior (described below). In rare circumstances, you may need further customization. All the things you're likely to ever want to change appear first in the actual ``tbku`` script, and are briefly documented there. **ENVIRONMENT VARIABLES & DEFAULTS** You can override the various ``tbku`` defaults by setting a corresponding environment variable. ================= =============================== ====================== **Env. Variable** **Default Value** **Meaning** ----------------- ------------------------------- ---------------------- TBKUDIR /bku Where to write backups TBKUNAME $MACHINE-$OSTYPE-$OSREV-$HWTYPE Tarball base name TBKUSETS $HOME/tbku Filesets found here TBKUTAPE /dev/sa0 Tape device (or file) ================= =============================== ====================== Examples:: export TBKUDIR=/mnt/backups # Backups written to /mnt/backups export TBKUNAME=JoeBackup # Backups named: JoeBackup- export TBKUSETS=/tbku # Looks for filesets in /tbku export TBKUTAPE-/tmp/faketape # Tape backups actually written to *file* **UPDATES & SUPPORT** To get the latest version of 'tbku', go to: http://www.tundraware.com/Software/tbku For questions, comments, or other feedback, send email to: tbku@tundraware.com **AUTHOR** Tim Daneliuk, TundraWare Inc. **COPYRIGHT & LICENSING** ``tbku`` is Copyright (c) 2004-2008, TundraWare Inc., Des Plaines, IL, USA There is no fee for using ``tbku`` either personally or commercially *so long as the terms of the tbku license are met*. Please read the ``tbku-license.txt`` file for a full explanation of the licensing terms. **DOCUMENT INFORMATION** This document was produced using the very useful ``reStructuredText`` tools in the ``docutils`` package. For more information, see: http://docutils.sourceforge.net/rst.html ``$Id: tbku.txt,v 1.105 2008/03/19 16:31:36 tundra Exp $``