#!/usr/local/bin/perl
#-----------------------------------------------
# $Id: dumptables.pl,v 1.1 1998/03/03 16:38:17 shevett Exp $
#-----------------------------------------------
#
# Dump mysql tables.  Command-line, no DBD::DBI.
#

$mysql			=	"/usr/local/bin/mysql";
$mysqldump	=	"/usr/local/bin/mysqldump";
$dbase			=	"keystone";

open(DB,"echo 'show tables' \| $mysql $dbase |");
while (<DB>) {
	next if (/^Tables/);
	chop;
	$dumpname = "${_}.dump";
	print "Dumping $_ to $dumpname ... \n";
	system("$mysqldump $dbase $_ > $dumpname");
	print "Done.\n";
}
