[ejabberd] another patch

Leif Johansson leifj at it.su.se
Tue May 4 00:21:45 MSD 2004


Support for text-load and restore in ejabber_ctl.erl (might come in
handy) plus a little bugfix.

	Best R
	Leif Johansson
-------------- next part --------------
--- ejabberd_ctl.erl.orig	Mon May  3 22:18:21 2004
+++ ejabberd_ctl.erl	Mon May  3 22:19:34 2004
@@ -74,6 +74,8 @@
     case rpc:call(Node, mnesia, backup, [Path]) of
 	{atomic, ok} ->
 	    ok;
+        ok ->
+	    ok;
 	{error, Reason} ->
 	    io:format("Can't store backup in ~p on node ~p: ~p~n",
 		      [Path, Node, Reason]);
@@ -82,6 +84,30 @@
 		      [Path, Node, Reason])
     end;
 
+process(Node, ["dump", Path]) ->
+    case rpc:call(Node, mnesia, dump_to_textfile, [Path]) of
+	ok ->
+	    ok;
+	{error, Reason} ->
+            io:format("Can't store dump in ~p on node ~p: ~p~n",
+                      [Path, Node, Reason]);
+        {badrpc, Reason} ->
+            io:format("Can't store dump in ~p on node ~p: ~p~n",
+                      [Path, Node, Reason])
+    end;
+
+process(Node, ["load", Path]) ->
+    case rpc:call(Node, mnesia, load_textfile, [Path]) of
+        ok ->
+            ok;
+        {error, Reason} ->
+            io:format("Can't load dump in ~p on node ~p: ~p~n",
+                      [Path, Node, Reason]);
+        {badrpc, Reason} ->
+            io:format("Can't load dump in ~p on node ~p: ~p~n",
+                      [Path, Node, Reason])
+    end;
+
 process(Node, ["restore", Path]) ->
     case rpc:call(Node,
 		  mnesia, restore, [Path, [{default_op, keep_tables}]]) of


More information about the ejabberd mailing list