#! /usr/local/bin/perl

#
# Copyright (c) 1990 The Ohio State University.
# All rights reserved.
#
# Redistribution and use in source and binary forms are permitted
# provided that: (1) source distributions retain this entire copyright
# notice and comment, and (2) distributions including binaries display
# the following acknowledgement:  ``This product includes software
# developed by The Ohio State University and its contributors''
# in the documentation or other materials provided with the distribution
# and in all advertising materials mentioning features or use of this
# software. Neither the name of the University nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#

$options = "";
$usage = "usage: test-restore";

do 'yagrip.pl' || 
  die "Can't do yagrip.pl";

do 'backup.defs' ||
  die "Can't do backup.defs";

do $backuplib_file ||
  die sprintf("Can't do %s", $backuplib_file);

&read_config();			# Read backup.config file

$host = shift;
$directory = shift;
if ($#ARGV >= 0) {
    $when = shift + 0;
} else {
    $when = time;
}

&get_recent_backups($host, $directory, $when, *list);
@keywords = &get_best_sequence(*list);

foreach $key (@keywords) {
    %result = ();
    &parse_db_entry($list{$key}, *result);

    printf("%s\n", $key);

    while (($k, $v) = each %result) {
	printf("    %s:\t%s\n",
	       $k,
	       $v);
    }
}

exit(0);


