#
# Local configuration definitions that might change from host to host
#
# 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.
#

    #
    # This is a list of the file system types in fstab or checklist 
    # that represent local file systems.  check-backups uses this to 
    # detect file systems that aren't mentioned in /etc/backups.
    #
    # Its SAFE to add entries.  If you delete an entry, then
    # check-backups won't know that that's an entry to pay attention
    # to.  
@fs_types = ("4.2", "4.3", "hfs", "ufs");

    #
    # Whether to use the .chain files or not.  These are intended to 
    # detect cases where a full restore has been done on a file system,
    # or where a full dump failed and needs to be redone.  Unfortunately, 
    # its common for the .chain files to get screwed up in other ways
    # so I've found them to be more annoying than useful.
    #
    # SAFE to change when you want.
    #
$use_chain_files = 0;

    #
    # ... per-host list of what to backup...might be useful to change 
    # this in test configurations.  This is SAFE to change at any
    # time.
    #
$backup_file =		"/etc/backups";

    #
    # Program that the tape checker should invoke.  Should accept a
    # message on stdin and do something useful with it.  SAFE to
    # change. 
    #
$bitch_prog =		"/usr/athena/bin/zwrite -d -q -n -i sipb";

    #
    # set to 1 if you are using a version of GNU tar that supports the 
    # listed-incremental option (such as GNU tar 1.10).  SAFE to change.
    #
$gtar_listed_incrementals = 1;

    #
    # Where the tardates file is, and where the exclude file is.  
    # These are SAFE to change at any time.
    #
$tardates =		"/etc/tardates";
$exclude =		"-X $db_dir/exclude";

    #
    # Where the lock file for the /etc/dumpdates file should go.
    # Should be unique to each host, which is why its set to this
    # instead of being put in $db_dir.
    #
    # SAFE to change, though you shouldn't need to.
    #
$dump_lock =		"/tmp/dumpdates";

#----------------------------------------------------------------------
# You shouldn't need to change much of anything down below.
#----------------------------------------------------------------------

    #
    # Where to look for things...you might want to add other entries.
    # CAREFUL - I wouldn't remove anything from the list.
    #
@search_path = ("/afs/athena.mit.edu/project/gnu/bin", "/usr/ucb",
		"/bin", "/usr/bin", "/usr/etc", "/etc", "/usr/sbin", "sbin",
		"/usr/local/bin", "/usr/lib");

    #
    # simple routine for finding things.  Uses search_path, returns pathname
    # to the first occurance of $what that it can find.
    #
sub find {
    local($file, $dir, $pathname);

    foreach $file (@_) {
	foreach $dir (@search_path) {
	    $pathname = "$dir/$file";
	    return($pathname) if -x $pathname;
	}
    }

    printf stderr "can't find a copy of '%s' anywhere.\n",
           join(' ', @_);
    return("");
}

$hostname_prog =	&find("hostname");

    #
    # You shouldn't need to change this.
    #
if (! defined($hostname)) {
    open(HOST, "$hostname_prog |") || die "can't get the hostname";
    chop($hostname=<HOST>);
    close(HOST);

    ($hostname) = split(/\./, $hostname);
}

    #
    # ... misc. programs...
    # You shouldn't need to change these in general.  You can replace
    # them with full path names instead of using &find() if you need
    # to. 
    #
$at_prog =		&find("at");
$cat_prog =		&find("cat");
$chgrp_prog =		&find("chgrp");
$chmod_prog =		&find("chmod");
$cp_prog =		&find("cp");
$date_prog =		&find("date");
$dd_prog =		&find("dd");
$egrep_prog =		&find("egrep");
    #
    # assumed to be a BSD style df.  parallel backup stuff in all-backups will 
    # fail if it isn't.
    #
$df_prog =		&find("df");
    #
    # sigh, dump and rdump aren't always interchangeable.  for simplicity, 
    # we'll use rdump when we deal with tapes, dump when we deal with the 
    # disk (even though dump would suffice for a local tape).
    #
    #  more sigh -- solaris doesn't seem to have these
$dump_prog =		"/lib/fs/ufsdump";
$rdump_prog =		"/lib/fs/ufsdump";
$dump_restore_prog =	"/lib/fs/ufsrestore";
    #
    # Can be anything that will halt and reboot the system, or force /etc/rc 
    # to be run again.
    #
    # You should eliminate the conditional.  I just included it as an
    # example, since we need to do something like this on one host,
    # you might have to also.
    #
if ($hostname eq "saqqara") {	# miserable pyramids...
    $fastboot_prog =	&find("reboot");
} else {
    $fastboot_prog =	&find("fastboot", "reboot");
}
    #
    # Can be anything that delivers local mail, if it accepts the message on 
    # stdin and takes a subject with a -s flag.  Use mailx (HP's name for 
    # Berkeley mail) if it exists, or mail and hope you get /usr/ucb/mail 
    # rather than /bin/mail. 
    #
$mail_prog =		&find("mailx", "mail");
$rm_prog =		&find("rm");
#$rsh_prog =		&find("rsh");
$rsh_prog = "/usr/local/backup/bin/krsh";
$rsh_user_to_tape = "rmt";

$sendmail_prog =	&find("sendmail");
    #
    # Has to support remote tapes, various GNU tar flags.
    # We only need this if we are using GNU tar.  Leave this
    # commented if you don't have GNU tar.
    #
$gtar_prog =		&find("gtar");
    #
$tee_prog =		&find("tee");
$compress_prog =	&find("compress");
$zcat_prog =		&find("zcat");

    #
    # How to convert a device name into a raw device name...uncomment
    # a suitable routine, comment out the rest.  You might need to
    # change this to support hosts that don't use /dev/rsd* or
    # /dev/rsdk/* to name raw disk devices.
    #
sub cvt_raw {				# prepend r to device name...sun, 
    local($dev) = @_;			# others

    if (-d "/dev/rdsk") {		# /dev/dsk/* ==> /dev/rsdk/*, for HP
        $dev =~ s,^/dev/dsk/,/dev/rdsk/,;
    } else {
	$dev =~ s,/([^/]+)$,/r$1,;
    }
    return($dev);
}

1;
