#
# Global definitions - these should (probably) be common across all
# platforms that you install TBS on.  If there's something that you
# need to change (and can change safely), move it to local.defs.
#
# I've added comments to indicate the consequences of changing things.
# CAREFUL means that you can change something anytime, but to be
# particularly careful about side effects.  SAFE means that you can
# change it anytime you want.  UNSAFE means that if you change it
# after you've started a database, you'll screw things up.
#

    #
    # The timezone we are working in...SAFE to change (should only
    # affect the format of dates in output).
    #
$our_timezone = "EST5EDT";

    #
    # Units of time, measured in seconds.  These shouldn't change unless 
    # you are debugging things and want to cycle through 1 day per hour 
    # or something.  Changing them after you've set up the database will
    # probably result in spurious results from clean-db.  If you
    # change them, be CAREFUL.
    #
$MINUTES =		60;
$HOURS =		60 * 60;
$DAYS =			24 * $HOURS;

    #
    # How long a log lock timeout should be (this should be longer 
    # than the longest backup will run, measured in seconds.)
    # Shouldn't need to be different on different hosts, but could be.  
    # You can safely change this, though if you make it shorter than
    # the longest backup run will take to finish, you'll short circuit
    # the locking process and things might get screwy.  Be CAREFUL.
    #
$long_timeout =		10 * $HOURS;

    #
    # How long should a promised tape be left alone?  This should be 
    # longer than the greatest span between when you set up a backup 
    # and when it starts.  In other words, if you commonly schedule 
    # backups 6 days in advance, you want to set this to at least 6 
    # days so that the tapes aren't freed and requested for another 
    # backup run in the meantime.  You can change this safely any
    # time.  If you make it too short, clean-db might free tapes that
    # are promised for runs that haven't started yet.  Be CAREFUL.
    #
$promised_timeout =	1 * $DAYS;

    #
    # clean-db log timeout - how long to retain the output from previous 
    # clean-db commands?  SAFE to change when you want.
    #
$clean_db_timeout =	14 * $DAYS;

    #
    # Default value for 'keep' for chains/levels that are no 
    # longer defined... If you reduce these, backups in the database
    # might expire (if their chains are no longer defined in
    # backup.config), so be CAREFUL.
    #
$default_keep{"0"} =	365 * $DAYS;
$default_keep{"2"} =	 28 * $DAYS;
$default_keep{"9"} =	 14 * $DAYS;
$default_keep{"default"} = 365 * $DAYS;

    #
    # default tape type and format for tapes that don't have a type or 
    # format set yet.  This should only be used by clean-db where it 
    # sanitizes tape database entries, and only when the tape entry is
    # missing a tape type.
    #
    # Careful, we're not checking these to see if they match what you 
    # declared in your backup.config file.
    #
$default_tape_type = "exb";
$default_tape_format = "8200";

    #
    # Where to put online backups by default.  Make sure this is in
    # @online_repositories.  If you move this and there are online
    # backups, the references to them in the backup databases will
    # become invalid.  Be CAREFUL.  If you just want to change this
    # and leave the old directory behind until it is empty, that's
    # SAFE. 
    #
$backup_dir =		"/n/pun/1/backups-test";

    #
    # List of directories where online backups might be kept.  If you
    # remove a directory from the list, clean-db won't clean expired
    # backups out of it.  Beware.  You can add/delete things when you
    # want SAFEly.
    #
@online_repositories = ($backup_dir,		"/n/misc/0/repository", 
		        "/n/misc/1/repository",	"/n/misc/2/repository",
			"/n/misc/3/repository",	"/n/misc/4/repository",
			"/n/misc/5/repository");

    #
    # ... database files...change ONLY if you move the directory.  Be
    # CAREFUL.  Needs to be the same on all hosts that share the
    # database. 
    #
$db_dir =		"/n/pun/1/backup-db";

    #
    # ... database file extension (dir for dbm/ndbm, db for BSD
    # db)...change only if you know what you are doing.  Be CAREFUL.
    # Needs to be the same on all hosts that share the database.
    #
$dbext =		"dir";

    #
    # ... backup system programs...change this when you want, but be
    # sure to really move things also.  Be CAREFUL.  This should be
    # the same on all hosts (since they need to be able to rsh to each
    # other to run things).
    #
$bdir =			"/usr/local/utils/nbu";

#----------------------------------------------------------------------
# You probably don't need to change anything below this point.
#----------------------------------------------------------------------

    #
    # ... backup system programs...you can probably change these
    # safely, I've never tried.
    #
$all_backup_prog =	"$bdir/all-backups";
$backend_prog =		"$bdir/backend";
$do_backup_prog =	"$bdir/do-backups";
$backup_prog =		"$bdir/backup";
$lock_prog =		"$bdir/lock";
$restore_prog =		"$bdir/restore";
$backup_init_prog =	"$bdir/backup-init";
$backup_cleanup_prog =	"$bdir/backup-cleanup";
$tape_check_prog =	"$bdir/tape-check";
$clean_db_prog =	"$bdir/clean-db";

    #
    # I suggest leaving these alone.  These are the names of the 
    # files that comprise the database...they ought to be in $db_dir.
    # Don't change these.  UNSAFE.
    #
$backup_config =	"$db_dir/backup.config";
$run_sequence =		"$db_dir/run-id";
$backup_sequence =	"$db_dir/backup-id.";
$tape_sequence =	"$db_dir/tape-id";
$tape_db_file =		"$db_dir/tape.db";
$run_db_file =		"$db_dir/run.db";
$run_host_file =	"$db_dir/run.db.";
$backup_host_file =	"$db_dir/backup.db.";
$file_dir =		"$db_dir/files";
$error_dir =		"$db_dir/errors";
$lock_dir =		"$db_dir/locks";

    #
    # This is only used if you are using GNU tar 1.10 or greater
    # Change this when you want, as long as you move the contents
    # also. 
    #
$tar_db_dir =		"$db_dir/tar-db-dir";

    #
    # Where to put clean-db logs and the normal log file.
    # SAFE to change when you want, if you move the old stuff
    # accordingly. 
    #
$clean_db_log_dir =	"$db_dir/clean-db-log";
$log_file =		"$db_dir/log";

    #
    # Name of various libraries that get loaded.  You shouldn't need
    # to change these.
    #
$backuplib_perl =	'backuplib.perl';
$ctime_perl =		'ctime.pl';
$lib_db_perl =		'lib-db.perl';
$lib_lock_perl =	'lib-lock.perl';
$lib_log_perl =		'lib-log.perl';
$lib_misc_perl =	'lib-misc.perl';
$lib_tape_perl =	'lib-tape.perl';
$unctime_perl =		'lib-unctime.perl';
$yagrip_perl =		'yagrip.pl';

    #
    # SHELL to use for children.  This can be different, though it
    # must be upward-compatible with the Bourne shell.  You shouldn't
    # need to change it though.
    #
$ENV{"SHELL"} = "/bin/sh";

    #
    # List of valid archive types.  Add entries as needed.
    #
%valid_archive_types = ("dump", 1,
			"gtar", 1, 
			"none", 1);

    #
    # Magic string to use in tape labels.  Don't change this once you've 
    # added tapes, since it gets written into tape labels.
    #
$tape_magic =		"xyZZy";

    #
    # Mode and umask to use for just about everything.  You shouldn't need
    # to change this.
    #
$db_mode =		0660;
umask(007);


1;
