Newer
Older
tbku / tbku.txt
**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 files.  It is useful both for producing
  incremental backups or 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.

  The central benefit of using ``tbku`` over hand written ``tar``
  commands is that ``tbku`` is "table driven".  You specify the set
  of files to back up in a table (a separate file).  You can have as
  many of these "filesets" as you wish, corresponding to different
  kinds of backups you want done.  ``tbku`` will do backups
  automatically or manually, based on the name of the "fileset".  This
  considerably simplifies automating backups, keeping backup logs, and
  generally maintaining an orderly backup environment.

  ``tbku`` was originally developed as a backup tool for FreeBSD
  servers.  Since then, it has been updated to also work with SUSE
  Linux, both servers and desktops.  ``tbku`` should work with little-
  or no modification on any other Unix-like system.  For example,
  ``tbku`` will run without modification (other than default
  locations) in a ``cywgin`` environment under MS-Windows.


**INSTALLING tbku**

  To use ``tbku``, all you have to do is install the file somewhere in
  your ``$PATH``.  Typically, a good place for it is in
  ``/usr/local/bin``.  Just make sure its permissions are 755 so all
  users will be able to use it.

  You may optionally want to put ``tbku.1.gz`` somewhere in your
  ``$MANPATH`` so this documentation will be available as a man page.

  There is also a ``tbku`` port for FreeBSD users that automates the
  installation and deinstallation of ``tbku``.

  Once you've installed the program, you should verify that its
  default settings are to your liking.  If not, you can override them
  via environment variables (described later in this document).  For
  interactive use, make sure the environment variables you want to set
  are exported when you log in.  If you're running ``tbku`` from a
  ``cron`` job, be sure to set the environment variables of interest
  in the ``crontab`` file.


**USING tbku**

  ``tbku`` has to know just *what* you want backed up.  You do
  this by creating a so-called *fileset* in the appropriate
  directory (default: ``$HOME/tbku/``).  Filesets are just text
  files that list all the files and/or directories that are
  to be backed up together.  For instance, suppose you had
  a fileset called ``manual.fileset.homedirs`` that contained
  just these three lines::

    /root
    /home
    /usr/home

  If you now run this command::

    tbku homedirs

  The files and/or contents of ``/root``, ``/home``, and ``/usr/home``
  would be written to a tarball in the backup directory (default:
  ``/bku/``).  By default, the resulting tarball's name has a long
  string of text that includes the machine name, system type, OS type,
  date, *and* the so-called *set name*.  The "set name" is nothing
  more than the suffix of the fileset used to produce the tarball, in
  this case, ``homedirs``.  Additionally, you also find a log of
  the backup and "dot files" that tell you when the backup began
  and when it ended. Here's part of what you might see if you did
  an ``ls -al /bku``::

    Mar 19 05:46 .mach.fake.org-FreeBSD-6.3-STABLE-i386-homedirs-begin
    Mar 19 05:47 .mach.fake.org-FreeBSD-6.3-STABLE-i386-homedirs-end
    Mar 19 05:46 mach.fake.org-FreeBSD-6.3-STABLE-i386-homedirs-20080319.tar.gz
    Mar 19 05:46 mach.fake.org-FreeBSD-6.3-STABLE-i386-homedirs.log


**IMAGING WITH tbku**

It is possible to use ``tbku`` backups to completely (re)image a
machine.  The general idea is to have ``tbku`` produce a tarball with
the entire system you want to "clone" in it.  Then, you can dump that
onto a newly prepared filesystem on the target machine.

The ``tbku`` distribution contains separate documents that describe
in detail how to image both FreeBSD and SUSE Linux systems.  You can also
read the documents on line at:

    http://www.tundraware.com/Software/tbku


**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-<filesetname>

    export TBKUSETS=/tbku          # Looks for filesets in /tbku

    export TBKUTAPE-/tmp/faketape  # Tape backups actually written to *file*


**OTHER**

  ``tbku`` is intended to make it easier/more automatic to
  to backups.  It is not, however, idiot-proof.  There are
  some general backup guidelines you should observe:

    **NEVER, EVER, EVER, EVER, EVER ... EVER**, trust a backup tool
    until you've confirmed that it is correctly producing backups
    **and** you can properly restore from them!

    Always keep multiple copies of your backups.  If ``tbku`` is
    writing its backups to the same drive/system it runs on, **make
    sure you also keep a copy of those backups "off system"**.

    It's a pretty good idea to keep **multiple backup copies**, on
    **different media** (disk, tape, DVD, thumbdrive), in **different
    locations**.


**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.106 2008/03/19 17:25:38 tundra Exp $``