<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>chys&#039;s random notes &#187; logrotate</title>
	<atom:link href="http://en.chys.info/tag/logrotate/feed/" rel="self" type="application/rss+xml" />
	<link>http://en.chys.info</link>
	<description>Study more problems; Talk less of isms.</description>
	<lastBuildDate>Tue, 27 Dec 2011 11:56:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>[Gentoo] Logrotating emerge.log</title>
		<link>http://en.chys.info/2009/04/logrotating-emergelog/</link>
		<comments>http://en.chys.info/2009/04/logrotating-emergelog/#comments</comments>
		<pubDate>Sat, 04 Apr 2009 18:20:50 +0000</pubDate>
		<dc:creator>chys</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[logrotate]]></category>
		<category><![CDATA[portage]]></category>

		<guid isPermaLink="false">http://en.chys.info/?p=452</guid>
		<description><![CDATA[It seems the reason why emerge.log is not logrotate&#8216;d is that log analyzers (qlop and genlop) expect a full log. I&#8217;m not sure about qlop, but since I use only genlop, it seems okay to add it to /etc/logrotate.d &#8211; genlop supports reading logs from multiple files and also from compressed files (gzip and bzip2). [...]<hr/>
Related posts:<ol>
<li><a href='http://en.chys.info/2009/05/liblzmadec-sucks/' rel='bookmark' title='liblzmadec sucks'>liblzmadec sucks</a></li>
<li><a href='http://en.chys.info/2009/03/gentoo-begins-to-mark-gcc-43-stable/' rel='bookmark' title='Gentoo begins to mark gcc-4.3 stable'>Gentoo begins to mark gcc-4.3 stable</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>It seems the reason why <code>emerge.log</code> is not <a href="https://fedorahosted.org/logrotate/">logrotate</a>&#8216;d is that log analyzers (<code>qlop</code> and <code>genlop</code>) expect a full log. I&#8217;m not sure about <code>qlop</code>, but since I use only <code>genlop</code>, it seems okay to add it to <code>/etc/logrotate.d</code> &#8211; <code>genlop</code> supports reading logs from multiple files and also from compressed files (<code>gzip</code> and <code>bzip2</code>).</p>
<p>Create a logrotate configuration file. <code>/etc/logrotate.d/emergelog</code>:</p>
<blockquote><pre>/var/log/emerge.log {
    compresscmd /bin/bzip2
    uncompresscmd /bin/bunzip2
    compressext .bz2
    rotate 100
    create 660 portage portage
    delaycompress
    daily
    size 2M
}</pre>
</blockquote>
<p>I configured my logrotate to compress using <code><a href="http://tukaani.org/lzma/">lzma</a></code> by default, but <code>genlop</code> recognizes only <code>gz</code> and <code>bz2</code>, so I need to explicitly specify <code>bzip2</code> (or <code>gzip</code>) here.</p>
<p>A wrapper for genlop is also necessary. <code>/usr/local/bin/genlop</code>:</p>
<blockquote><pre>#!/bin/bash

f=()
for x in /var/log/emerge.log*; do
    f=("${f[@]}" -f "$x")
done
exec /usr/bin/genlop "${f[@]}" "$@"</pre>
</blockquote>
<hr/><p>Related posts:<ol>
<li><a href='http://en.chys.info/2009/05/liblzmadec-sucks/' rel='bookmark' title='liblzmadec sucks'>liblzmadec sucks</a></li>
<li><a href='http://en.chys.info/2009/03/gentoo-begins-to-mark-gcc-43-stable/' rel='bookmark' title='Gentoo begins to mark gcc-4.3 stable'>Gentoo begins to mark gcc-4.3 stable</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://en.chys.info/2009/04/logrotating-emergelog/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

