<a href="http://www.apache.org/">Apache</a> > <a href="http://httpd.apache.org/">HTTP Server</a> > <a href="http://httpd.apache.org/docs/">Documentation</a> > <a href="../">Version 2.3</a> > <a href="./">Programs</a></div><div id="page-content"><div id="preamble"><h1>rotatelogs - Piped logging program to rotate Apache logs</h1>
<div class="toplang">
<p><span>Available Languages: </span><a href="../en/programs/rotatelogs.html" title="English"> en </a> |
-<a href="../ko/programs/rotatelogs.html" hreflang="ko" rel="alternate" title="Korean"> ko </a></p>
+<a href="../ko/programs/rotatelogs.html" hreflang="ko" rel="alternate" title="Korean"> ko </a> |
+<a href="../tr/programs/rotatelogs.html" hreflang="tr" rel="alternate" title="Türkçe"> tr </a></p>
</div>
<p><code>rotatelogs</code> is a simple program for use in
<p><code><strong>rotatelogs</strong>
[ -<strong>l</strong> ]
+ [ -<strong>L</strong> <var>linkname</var> ]
[ -<strong>f</strong> ]
[ -<strong>v</strong> ]
<var>logfile</var>
changes the GMT offset (such as for BST or DST) can lead to unpredictable
results!</dd>
+<dt><code>-L</code> <var>linkname</var></dt>
+<dd>Causes a hard link to be made from the current logfile
+to the specified link name. This can be used to watch
+the log continuously across rotations using a command like
+<code>tail -F linkname</code>.</dd>
+
<dt><code>-f</code></dt>
<dd>Causes the logfile to be opened immediately, as soon as
<code>rotatelogs</code> starts, instead of waiting for the
associated logfile does not "exist" until then, which
causes problems from some automated logging tools)</dd>
+<dt><code>-t</code></dt>
+<dd>Causes the logfile to be truncated instead of rotated. This is
+useful when a log is processed in real time by a command like tail,
+and there is no need for archived data. No suffix will be added to
+the filename, however format strings containing '%' characters
+will be respected.
+</dd>
+
<dt><code>-v</code></dt>
<dd>Produce verbose output on STDERR. The output contains
the result of the configuration parsing, and all file open and
includes any '%' characters, it is treated as a format string for
<code>strftime(3)</code>. Otherwise, the suffix
<var>.nnnnnnnnnn</var> is automatically added and is the time in
-seconds. Both formats compute the start time from the beginning of
-the current period. For example, if a rotation time of 86400 is
-specified, the hour, minute, and second fields created from the
-<code>strftime(3)</code> format will all be zero, referring to the
-beginning of the current 24-hour period (midnight).</dd>
+seconds (unless the -t option is used). Both formats compute the
+start time from the beginning of the current period. For example,
+if a rotation time of 86400 is specified, the hour, minute, and
+second fields created from the <code>strftime(3)</code> format will
+all be zero, referring to the beginning of the current 24-hour
+period (midnight).</dd>
<dt><code><var>rotationtime</var></code></dt>
will be created of the form
<code>errorlog.YYYY-mm-dd-HH_MM_SS</code>.</p>
+<div class="example"><p><code>
+ CustomLog "|bin/rotatelogs -t /var/logs/logfile 86400" common
+</code></p></div>
+
+ <p>This creates the file /var/logs/logfile, truncating the file at
+ startup and then truncating the file once per day. It is expected
+ in this scenario that a separate process (such as tail) would
+ process the file in real time.</p>
+
</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="section">
<h2><a name="portability" id="portability">Portability</a></h2>
</div></div>
<div class="bottomlang">
<p><span>Available Languages: </span><a href="../en/programs/rotatelogs.html" title="English"> en </a> |
-<a href="../ko/programs/rotatelogs.html" hreflang="ko" rel="alternate" title="Korean"> ko </a></p>
+<a href="../ko/programs/rotatelogs.html" hreflang="ko" rel="alternate" title="Korean"> ko </a> |
+<a href="../tr/programs/rotatelogs.html" hreflang="tr" rel="alternate" title="Türkçe"> tr </a></p>
</div><div id="footer">
-<p class="apache">Copyright 2009 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>
+<p class="apache">Copyright 2010 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>
<p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div>
</body></html>
\ No newline at end of file