jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1547751 - /jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/run/Main.java
Date Wed, 04 Dec 2013 10:31:31 GMT
Author: jukka
Date: Wed Dec  4 10:31:30 2013
New Revision: 1547751

URL: http://svn.apache.org/r1547751
Log:
OAK-1159: Backup and restore

Add a "backup" mode to oak-run

Modified:
    jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/run/Main.java

Modified: jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/run/Main.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/run/Main.java?rev=1547751&r1=1547750&r2=1547751&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/run/Main.java (original)
+++ jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/run/Main.java Wed
Dec  4 10:31:30 2013
@@ -40,6 +40,7 @@ import org.apache.jackrabbit.oak.benchma
 import org.apache.jackrabbit.oak.http.OakServlet;
 import org.apache.jackrabbit.oak.jcr.Jcr;
 import org.apache.jackrabbit.oak.kernel.KernelNodeStore;
+import org.apache.jackrabbit.oak.plugins.backup.FileStoreBackup;
 import org.apache.jackrabbit.oak.plugins.segment.Segment;
 import org.apache.jackrabbit.oak.plugins.segment.SegmentIdFactory;
 import org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStore;
@@ -87,6 +88,16 @@ public class Main {
                 System.err.println("usage: upgrade <olddir> <newdir>");
                 System.exit(1);
             }
+        } else if ("backup".equals(command)) {
+            if (args.length == 2) {
+                FileStore store = new FileStore(new File(args[0]), 256, false);
+                FileStoreBackup.backup(
+                        new SegmentNodeStore(store), new File(args[1]));
+                store.close();
+            } else {
+                System.err.println("usage: backup <repository> <backup>");
+                System.exit(1);
+            }
         } else if ("tarmk".equals(command)) {
             if (args.length == 0) {
                 System.err.println("usage: tarmk <path> [id...]");



Mime
View raw message