]> git.ipfire.org Git - thirdparty/snapper.git/commitdiff
- be "nice" during background tasks
authorArvin Schnell <aschnell@suse.de>
Fri, 4 Mar 2011 14:49:27 +0000 (15:49 +0100)
committerArvin Schnell <aschnell@suse.de>
Fri, 4 Mar 2011 14:49:27 +0000 (15:49 +0100)
scripts/snapper-daily
scripts/snapper-hourly
snapper.spec.in
snapper/Snapper.cc
snapper/SnapperDefines.h

index 4a78a13022c630ef94d6042a0eb718fa86582c9d..197380a063f41fdf7487a1da80a5b6f0bb26837a 100755 (executable)
@@ -16,6 +16,13 @@ if [ -f /etc/sysconfig/snapper ] ; then
 fi
 
 
+#
+# be nice
+#
+/usr/bin/renice -n 19 -p $$
+/usr/bin/ionice -c 3 -p $$
+
+
 #
 # run snapper for all configs
 #
index 8f2d41fce2f3b9dab725db8aeda5585523f67dc1..3a8ef73cae91d61f8f8e4668b8644c845689de45 100755 (executable)
@@ -16,6 +16,13 @@ if [ -f /etc/sysconfig/snapper ] ; then
 fi
 
 
+#
+# be nice
+#
+/usr/bin/renice -n 19 -p $$
+/usr/bin/ionice -c 3 -p $$
+
+
 #
 # run snapper for all configs
 #
index 927707cd792f97b39a677a414b73a34d12906da0..8e66d1b35ed56f19559c827191502b947654b0ad 100644 (file)
@@ -57,7 +57,7 @@ rm -rf "$RPM_BUILD_ROOT"
 %package -n libsnapper
 Summary:       Library for filesystem snapshot management
 Group:         System/Libraries
-Requires:      btrfsprogs diffutils
+Requires:      btrfsprogs diffutils util-linux
 PreReq:                %fillup_prereq
 
 %description -n libsnapper
index 7de9f0cbb0985c33bf9e88b3e586d18e447675d8..308e95ba8fcfaebcaa3d2eb37496aa884f71e4f9 100644 (file)
@@ -150,7 +150,8 @@ namespace snapper
        string output = snapshot2->baseDir() + "/filelist-" + decString(snapshot1->getNum()) +
            ".txt";
 
-       SystemCmd(COMPAREDIRSBIN " " + quote(dir1) + " " + quote(dir2) + " " + quote(output));
+       SystemCmd(NICEBIN " -n 19 " IONICEBIN " -c 3 " COMPAREDIRSBIN " " + quote(dir1) + " " +
+                 quote(dir2) + " " + quote(output));
     }
 
 
index ca3847629d718ab29b6d522b422d047198aa0dc0..da81b465d287abacf72dea8f152d2243cae5e71c 100644 (file)
@@ -33,6 +33,9 @@
 
 #define COMPAREDIRSBIN "/usr/lib/snapper/bin/compare-dirs"
 
+#define NICEBIN "/usr/bin/nice"
+#define IONICEBIN "/usr/bin/ionice"
+
 #define CPBIN "/bin/cp"
 
 #define DIFFBIN "/usr/bin/diff"