[MOBY-guts] biomoby commit

Mark Wilkinson mwilkinson at pub.open-bio.org
Wed Mar 5 15:22:01 UTC 2003


mwilkinson
Wed Mar  5 10:22:00 EST 2003
Update of /home/repository/moby/moby-live/Perl/MOBY
In directory pub.open-bio.org:/tmp/cvs-serv6990/Perl/MOBY

Modified Files:
	Central.pm 
Log Message:
added method DUMP to get a dump of the database.  Might not work.  Testing it now.
moby-live/Perl/MOBY Central.pm,1.11,1.12
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/Central.pm,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- /home/repository/moby/moby-live/Perl/MOBY/Central.pm	2003/03/02 07:47:36	1.11
+++ /home/repository/moby/moby-live/Perl/MOBY/Central.pm	2003/03/05 15:22:00	1.12
@@ -2514,6 +2514,31 @@
 	
 }
 
+
+=head2 DUMP
+
+ Title     :	DUMP
+ Usage     :	%valid = $MOBY->DUMP()
+ Function  :	return a mysql dump of the current MOBY Central database
+ Returns   :	text
+ Args      :	none
+
+=cut
+
+
+sub DUMP {
+	my ($pkg) = @_;
+    my $filename = "./MOBY/central.cfg";# $self->config;
+	$debug && &_LOG("trying to open file $filename\n");
+	open (IN, $filename) || die "can't open configuration file $filename:  $!";
+	my $url = <IN>; chomp $url;
+	my $dbname = <IN>; chomp $dbname;
+	my $username = <IN>; chomp $username;
+	my $password = <IN>; chomp $password;
+	return system "mysqldump -u $username -p $password MOBY_Central";
+}
+
+
 sub _flatten {
 	# from a given term, traverse the ontology
 	# and flatten it into a list of parent terms



More information about the MOBY-guts mailing list