[Piuparts-commits] [piuparts] 01/01: archive_old_logs: use xargs -P to compress old logs in parallel.

Holger Levsen holger at layer-acht.org
Sun Mar 5 13:01:21 UTC 2017


This is an automated email from the git hooks/post-receive script.

holger pushed a commit to branch develop
in repository piuparts.

commit 3d9da713ec6082ffba3358ae35c9dc56dcf05fe8
Author: Holger Levsen <holger at layer-acht.org>
Date:   Sun Mar 5 14:01:10 2017 +0100

    archive_old_logs: use xargs -P to compress old logs in parallel.
    
    Signed-off-by: Holger Levsen <holger at layer-acht.org>
---
 debian/changelog               | 1 +
 master-bin/archive_old_logs.in | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index 629e215..6ecf287 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -36,6 +36,7 @@ piuparts (0.76) UNRELEASED; urgency=medium
   * htdocs/index.tpl:
     - Announce 2nd piuparts-slave and explain this is a three host setup now.
     - Make "contribute" a link.
+  * archive_old_logs: use xargs -P to compress old logs in parallel.
 
   [ Michael Stapelberg ]
   * Add support for logging update-alternatives calls using optional
diff --git a/master-bin/archive_old_logs.in b/master-bin/archive_old_logs.in
index 5559802..18c56d0 100755
--- a/master-bin/archive_old_logs.in
+++ b/master-bin/archive_old_logs.in
@@ -52,7 +52,8 @@ for SECTION in $SECTIONS ; do
 			done
 		fi
 	done
-	find archive/ -name '*.log' | xargs -r xz -f
+	NUM_CPU=$(grep -c ^processor /proc/cpuinfo)
+	find archive/ -name '*.log' | xargs -P $NUM_CPU -r xz -f
 	if [ -n "$OUTPUT" ] ; then
 		echo
 		echo

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/piuparts/piuparts.git



More information about the Piuparts-commits mailing list