#
# 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 * $MINUTES;
$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 we wait for tape device locks?  See above.
    #
$tape_device_timeout =	24 * $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 =	7 * $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;

    #
    # stacker_delay is how long to wait for a tape stacker to change
    # tapes.  ideally, this ought to be set per device.
    #
$stacker_delay = 600;

    #
    # 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 remote user for rsh operations.  Define as '' for none.
    #
$default_remote_user = 'rmt';

    #
    # 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 =		"/afs/sipb.mit.edu/service/backups/backups";

    #
    # 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);

    #
    # ... database files...change ONLY if you move the directory.  Be
    # CAREFUL.  Needs to be the same on all hosts that share the
    # database. 
    #
$base_dir =		"/afs/sipb.mit.edu/service/backups";
$db_dir =		"$base_dir/misc";

    #
    # $db_server is the name of the server that holds the master copy of
    # the database directory.  $db_remote is the name of the
    # remote file system that is mounted locally as $db_local to make
    # $db_dir available for use.  This is used in single-begin and
    # single-end. 
    #
$db_server = 		"loopback";
$db_remote =		"$base_dir/backup";
$db_local =		"$base_dir/backup";

    #
    # ... 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";
#$dbext2 =		"pag";

    #
    # If you are using the BSD db library instead of dbm (or ndbm, gdbm, 
    # sdbm etc), then set this to be true.
    #
$use_db_file = 0;

if ($use_db_file) {
    $dbext = "db";
    undef $dbext2;

    #
    # Database parameters for ue with the BSD db library.  The default 
    # parameters don't match the characteristics of backup database files, 
    # and you can run into problems if you have very large databases.
    #
    $db_bsize = 8192;
    $db_ffactor = 682;
    $db_nelem = 1000;
}

    #
    # ... 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 =			"$base_dir/bin";

    #
    # This controls whether run-clean-db will send empty mail messages 
    # if nothing useful was done.  I personally prefer that, since that
    # way I know that run-clean-db ran, but you might want to set this
    # to 0.  Eventually this might control other mail things in the
    # backup system as well.
    #
$send_empty_mail = 	1;

    #
    # For sybase: which directories have which passwords, and use 
    # what temporary directories for the database dumps.
    #
$sybase_backup_user{"base:/n/base/0/sybase-backup"} = "MrBackup";
$sybase_backup_password{"base:/n/base/0/sybase-backup"} = "foo";
$sybase_backup_dsquery{"base:/n/base/0/sybase-backup"} = "SYBASE";

$sybase_backup_user{"cra:/n/cra/0/sybase-backup"} = "MrBackup";
$sybase_backup_password{"cra:/n/cra/0/sybase-backup"} = "foo";
$sybase_backup_dsquery{"cra:/n/cra/0/sybase-backup"} = "CRABASE";

$sybase_backup_user{"archive:/n/archive/0/sybase-backup"} = "MrBackup";
$sybase_backup_password{"archive:/n/archive/0/sybase-backup"} = "foo";
$sybase_backup_dsquery{"archive:/n/archive/0/sybase-backup"} = "SYBASE";

$sybase_backup_user{"soc:/n/soc/0/lattisware-backup"} = "MrBackup";
$sybase_backup_password{"soc:/n/soc/0/lattisware-backup"} = "foo";
$sybase_backup_dsquery{"soc:/n/soc/0/lattisware-backup"} = "LATTISWARE";

#----------------------------------------------------------------------
# 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/single-begin";
$backup_cleanup_prog =	"$bdir/single-end";
$tape_check_prog =	"$bdir/tape-check";
$clean_db_prog =	"$bdir/clean-db";
$mt_prog =		"$bdir/pmt";

    #
    # 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";
$sequence_ext =		"seq";
$tape_db_file =		"$db_dir/tape";
$run_db_file =		"$db_dir/run";
$run_host_file =	"$db_dir/run.";
$backup_host_file =	"$db_dir/backup.";
$file_dir =		"$base_dir/files";
$error_dir =		"$base_dir/errors";
$lock_dir =		"$db_dir/locks";
# $at_lock is in local.defs
$output_dir =		"$base_dir/output";
$deadman'deadman_dir =	"$base_dir/deadman";

    #
    # 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_db_extra_perl =	'lib-db-extra.perl';
$lib_deadman_perl =	'lib-deadman.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, 
			"null", 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";

    #
    # Modes and umask to use for just about everything.  You shouldn't need
    # to change this.
    #
$default_dir_mode =	0770;
$db_mode =		0660;

umask(007);


1;
