]> git.ipfire.org Git - thirdparty/snapper.git/commitdiff
- start background comparsion in snapper tool
authorArvin Schnell <aschnell@suse.de>
Fri, 14 Jan 2011 09:23:54 +0000 (10:23 +0100)
committerArvin Schnell <aschnell@suse.de>
Fri, 14 Jan 2011 09:23:54 +0000 (10:23 +0100)
snapper/Snapper.cc
snapper/SnapperDefines.h
snapper/SnapperInterface.h
tools/cli.cc

index bafa3f8ff74c6bf926829ea8807eed6c171b0327..9cb785d57b78bd8106c72beef708a0a0267cc5da 100644 (file)
@@ -289,6 +289,20 @@ namespace snapper
     }
 
 
+    void
+    startBackgroundComparsion(unsigned int num1, unsigned int num2)
+    {
+       y2mil("num1:" << num1 << " num2:" << num2);
+
+       string dir1 = SNAPSHOTSDIR "/" + decString(num1) + "/snapshot";
+       string dir2 = SNAPSHOTSDIR "/" + decString(num2) + "/snapshot";
+
+       string output = SNAPSHOTSDIR "/" + decString(num2) + "/files-" + decString(num1) + ".txt";
+
+       SystemCmd(COMPAREDIRSBIN " " + quote(dir1) + " " + quote(dir2) + " " + quote(output));
+    }
+
+
     bool
     setComparisonNums(unsigned int num1, unsigned int num2)
     {
index e242dd3753e04740ed0574fb7db9af19182e7120..02cf6f5926cca6c74a30d485cbdc134b94b8a00e 100644 (file)
@@ -30,5 +30,7 @@
 
 #define BTRFSBIN "/sbin/btrfs"
 
+#define COMPAREDIRSBIN "/usr/lib/snapper/bin/compare-dirs"
+
 
 #endif
index 7a4f68b3aa51991637df5d77b556c38255c1484a..b6a5c44652f39b516f31aa2781df15e6c8ae5d3e 100644 (file)
@@ -92,6 +92,8 @@ namespace snapper
 
     // use num = 0 for system
 
+    void startBackgroundComparsion(unsigned int num1, unsigned int num2);
+
     bool setComparisonNums(unsigned int num1, unsigned int num2);
 
     unsigned int getComparisonNum1();
index f186e15bea4d44951c4949024414ee2c99559b87..7acde7f981835f16378ac7e391654ff3afeb5b03 100644 (file)
@@ -59,7 +59,10 @@ void createSnap( const list<string>& args )
     else if( type=="pre" )
        createPreSnapshot(desc);
     else if( type=="post" )
-       createPostSnapshot(number);
+    {
+       unsigned int num2 = createPostSnapshot(number);
+       startBackgroundComparsion(number, num2);
+    }
     else
        y2war( "unknown type:\"" << type << "\"" );
     }