dobackup.pl
===========

Legal:

  Copyright 1997-2000 Webcon, Inc.

  This code is available for public use under the terms of the GNU Public
  License (GPL). See http://www.gnu.org/copyleft/gpl.html for license
  details. 

  Webcon reserves the right to modify the licensing terms for any future
  version of this product.

Contact:

  Product website: http://www.webcon.net/products/dobackup/

Quick overview:

  A flexible Perl script to handle unattended incremental backups of
  multiple servers. Handles multiple media sets with automatic media
  preparation and rotation, configurable 'what-to-backup', global exclusion
  patterns, user settable 'don't-backup-this-directory' metafiles. Design
  goal: zero-maintenance, nothing to do except change the media when told.

Syntax:

  -h, --help       Prints short usage instructions

  -d=INT           Enabled debugging mode. INT = verbosity level.
  --debug=INT      This adds lots of diagnostic output from many parts of
                   the program. Use this to track unexplained failures to a
                   specific part of the code.

  -v, --version    Prints version information

  --test           Part of the process of a normal backup is to verify that
                   all the pre-flight checks are good before beginning a
                   backup.  This includes such things as ensuring all
                   external programs are available, backup media is properly
                   configured, hosts to backup are alive, etc..

                   This option tells the program to exit after performing
                   the pre-flight checks, and do NOT actually perform the
                   backup or update any config file parameters.

  --config=STRING  Use an alternate configuration file named STRING.
                   (Default = /etc/dobackup.conf)

  --timestamp=REAL Normally, each backup collects files modified since the
                   the time of the previous backup. This option allows you
                   to override the timestamp of the previous backup with the
                   supplied value, REAL. The value is in standard Unix epoc
                   time.

  --host=STRING    Normally, each host in the config file is backed up in
                   turn. This option allows a single specified host (STRING)
                   from the config file to be backed up. All configuration
                   values for other hosts are left untouched.

  --rotate         Upon completion of this backup run, eject (if applicable)
                   the media and prepare to expect the next unit in a set of
                   media for the next backup.

                   When used with --test, a forced media rotation can be
                   accomplished without performing a backup.

Description:

  This program is designed to be a flexible backup program. It will work
  with reliable removable media such as JAZ drives, potentially unreliable
  removable media like tape drives, dedicated drive partitions or simply a
  directory on an existing partition.

  We currently prefer to backup to dedicated drive partitions since they
  can be unmount'ed, offering greater data security and integrity and
  cannot be easily stolen like removable media (unless they swipe the
  whole server).

  The Program determines what to backup by comparing timestamps:
    1. If a Host's TimeStamp = 0, a full backup occurs.
    2. If a Host's TimeStamp exists and is not 0, then a backup of all
       files modified after the TimeStamp occurs.

  Rather than depending on filesystem-dependent flags or attributes, this
  program takes advantage of hidden "dot" (.) files for per-directory
  user-controllable exclusions.

  By creating a ".nobackup" file in any directory, that directory (and
  anything below it) are excluded from the backup. This makes it easy for
  users to exclude large files which don't need to be backed up without
  bothering the sysadmin.

  The program is designed to be reliable. It makes use of many external
  tools, and since all paths are configurable and are potentially
  different on every system, all necessary external programs are verified
  prior to beginning the backup process, thereby ensuring the backup is
  able to complete successfully once started.

  By default, a backup summary report is e-mailed to the sysadmin (or any
  configured e-mail address) upon the completion of a successful backup, or
  upon encountering any internal failure.

  Verbose logs are stored by the program in a configurable log directory.
  Each log file is timestamped and host-stamped for easy tracking of
  individual backups. You can see exactly what files were backed up
  without having to dig out the actual backup media.

  Quite intentionally, the program does NOT check for enough remaining
  media space before starting the backup. In our opinion, it is better to
  have a partial backup written out, that none at all. Of course, your
  chosen archive tool (afio, by default) must be able to deal with
  partial files (afio does).

Preconditions:

  Program is intended to be run in root's crontab. All directories to be
  considered for backup should be listed one per line in the appropriate
  section of the config file. The system will recursively include any
  subdirectories under the ones listed.

Dependencies:

  On Redhat 6.2, dobackup uses tools from several packages. Not necessarily
  all of these will be required, depending on your specific configuration.

	afio
	eject
	fileutils
	grep
	iputils
	mount
	mt-st
	perl-5
	sendmail
	sh-utils
	textutils

  You'll also need these perl modules installed:

	IniConf
	Getopt::Mixed

To-do:

  Please see the TODO file, part of this distribution.

Uncategorized notes to be expanded on:

  -Device used for backups should have an appropriate entry in /etc/fstab
   (Disk & Filesyetem modes)

  -Tape mode unused and untested for years, probably broken.

  -Current exclusion rules (see TODO):
    Exclude anything in or below a directory with a .nobackup file
    Exclude ~/.netscape/cache
    Exclude ~/*.(lha|zip|t?gz|Z|tar)
    Exclude ~/(excludes|storage|dloads)
    Exclude ~/te?mp

  -Multiple (remote) hosts can be backed up from one system. Apropriate NFS,
   SMB or other network filesystem mounts are left to the user.
