<?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>Mission Data Blog &#187; logrotate</title>
	<atom:link href="http://www.missiondata.com/blog/tag/logrotate/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.missiondata.com/blog</link>
	<description>Louisville-based Web Development &#38; Software Engineering</description>
	<lastBuildDate>Tue, 24 Jan 2012 14:58:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>managing disk space with logrotate</title>
		<link>http://www.missiondata.com/blog/system-administration/48/managing-disk-space-with-logrotate/</link>
		<comments>http://www.missiondata.com/blog/system-administration/48/managing-disk-space-with-logrotate/#comments</comments>
		<pubDate>Thu, 27 Apr 2006 02:28:13 +0000</pubDate>
		<dc:creator>darrend</dc:creator>
				<category><![CDATA[System Administration]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[logrotate]]></category>
		<category><![CDATA[Utilities]]></category>

		<guid isPermaLink="false">http://blogs.missiondata.com/?p=48</guid>
		<description><![CDATA[At a customer site, the test and production linux servers for some intranet applications were slowly running out of disk space. The apps themselves were running fine, it was the logfiles generated by the apps that were the issue; logging that came in useful just in case something went wrong, but quickly aged. In one [...]]]></description>
			<content:encoded><![CDATA[<p>At a customer site, the test and production linux servers for some intranet applications were slowly running out of disk space. The apps themselves were running fine, it was the logfiles generated by the apps that were the issue; logging that came in useful just in case something went wrong, but quickly aged. In one particular case, a catalina.out file was several years old and was 11 gigabytes; 90% of it wasn&#8217;t really relevant any longer.</p>
<p>The solution to the problem of wrangling logfiles is probably already installed on your server: it&#8217;s <a href="http://iain.cx/src/logrotate/">logrotate</a>. Chances are logrotate is already configured in your system crontab as a daily task, and chances are it is configured to obey any configuration files found in the <tt>/etc/logrotate.d</tt> directory. If you find that directory, you are probably good to go.</p>
<p><span id="more-48"></span><br />
In <tt>/etc/logrotate.d</tt> you&#8217;ll find several short configuration files. Each configuration deals with 1 or 2 related logfiles that should be checked and possibly administered on a regular basis. Logrotate can do alot of things with a logfile: clear the target log, create a copy of it, compress the copy, keep <em>N</em> backup copies, and it can be configured to rotate the target logfile on a daily, weekly, or monthly basis.</p>
<p>For example, here is how my client handles a logfile generated by a log4j-enabled java rmi server:</p>
<pre>
<code> /appdir/log/java_rmi_log.txt {
    daily
    rotate 10
    copytruncate
    compress
    notifempty
    missingok
 }</code>
</pre>
<p>This configuration means<br />
<blockquote>On a <em>daily</em> basis <em>rotate</em>, <em>compress</em>, and retain up to <em>10</em> days worth of logs using the <em>copytruncate</em> method. But <em>notifempty</em>; if the log is empty don&#8217;t do anything. Finally, <em>missingok</em>, so no need to log an error anywhere if the target logfile isn&#8217;t found.
</p></blockquote>
<p>This is nigh on a <a href="http://en.wikipedia.org/wiki/Domain_Specific_Language">domain specific language</a> for logfile rotation, and like most DSLs I&#8217;ve come across it&#8217;s much easier to read than it is to remember when writing. Don&#8217;t worry, the <a href="http://www.die.net/doc/linux/man/man8/logrotate.8.html">man page for logrotate</a> lists all the details.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.missiondata.com/blog/system-administration/48/managing-disk-space-with-logrotate/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

