<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: logrotate in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/logrotate/m-p/4367742#M35389</link>
    <description>From Apache.org:&lt;BR /&gt;&lt;BR /&gt;Log Rotation&lt;BR /&gt;&lt;BR /&gt;On even a moderately busy server, the quantity of information stored in the log files is very large. The access log file typically grows 1 MB or more per 10,000 requests. It will consequently be necessary to periodically rotate the log files by moving or deleting the existing logs. This cannot be done while the server is running, because Apache will continue writing to the old log file as long as it holds the file open. Instead, the server must be restarted after the log files are moved or deleted so that it will open new log files.&lt;BR /&gt;&lt;BR /&gt;By using a graceful restart, the server can be instructed to open new log files without losing any existing or pending connections from clients. However, in order to accomplish this, the server must continue to write to the old log files while it finishes serving old requests. It is therefore necessary to wait for some time after the restart before doing any processing on the log files. A typical scenario that simply rotates the logs and compresses the old logs to save space is:&lt;BR /&gt;&lt;BR /&gt;mv access_log access_log.old&lt;BR /&gt;mv error_log error_log.old&lt;BR /&gt;apachectl graceful&lt;BR /&gt;sleep 600&lt;BR /&gt;gzip access_log.old error_log.old &lt;BR /&gt;&lt;BR /&gt;Rick Retterer&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Fri, 27 Feb 2009 00:07:17 GMT</pubDate>
    <dc:creator>Rick Retterer</dc:creator>
    <dc:date>2009-02-27T00:07:17Z</dc:date>
    <item>
      <title>logrotate</title>
      <link>https://community.hpe.com/t5/operating-system-linux/logrotate/m-p/4367739#M35386</link>
      <description>&lt;BR /&gt;We need to rotate the logs for Apache when they reach close to 2GB. I know logrotate can do that but can I achieve this without restarting Apache.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Allan</description>
      <pubDate>Thu, 26 Feb 2009 22:22:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/logrotate/m-p/4367739#M35386</guid>
      <dc:creator>Allanm</dc:creator>
      <dc:date>2009-02-26T22:22:38Z</dc:date>
    </item>
    <item>
      <title>Re: logrotate</title>
      <link>https://community.hpe.com/t5/operating-system-linux/logrotate/m-p/4367740#M35387</link>
      <description>Please read the description of the "copytruncate" directive from the logrotate man page. I have used it with success with Apache.&lt;BR /&gt;&lt;BR /&gt;Of course, the caveat of the "copytruncate" applies: if Apache writes new entries to the log file exactly at the moment after the old log is copied away but before the log is truncated to zero size, those log entries may be lost.&lt;BR /&gt;&lt;BR /&gt;MK</description>
      <pubDate>Thu, 26 Feb 2009 23:55:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/logrotate/m-p/4367740#M35387</guid>
      <dc:creator>Matti_Kurkela</dc:creator>
      <dc:date>2009-02-26T23:55:40Z</dc:date>
    </item>
    <item>
      <title>Re: logrotate</title>
      <link>https://community.hpe.com/t5/operating-system-linux/logrotate/m-p/4367741#M35388</link>
      <description>Thanks for replying Matti, but can you share your /etc/logrotate.d script with me.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Allan.</description>
      <pubDate>Fri, 27 Feb 2009 00:01:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/logrotate/m-p/4367741#M35388</guid>
      <dc:creator>Allanm</dc:creator>
      <dc:date>2009-02-27T00:01:20Z</dc:date>
    </item>
    <item>
      <title>Re: logrotate</title>
      <link>https://community.hpe.com/t5/operating-system-linux/logrotate/m-p/4367742#M35389</link>
      <description>From Apache.org:&lt;BR /&gt;&lt;BR /&gt;Log Rotation&lt;BR /&gt;&lt;BR /&gt;On even a moderately busy server, the quantity of information stored in the log files is very large. The access log file typically grows 1 MB or more per 10,000 requests. It will consequently be necessary to periodically rotate the log files by moving or deleting the existing logs. This cannot be done while the server is running, because Apache will continue writing to the old log file as long as it holds the file open. Instead, the server must be restarted after the log files are moved or deleted so that it will open new log files.&lt;BR /&gt;&lt;BR /&gt;By using a graceful restart, the server can be instructed to open new log files without losing any existing or pending connections from clients. However, in order to accomplish this, the server must continue to write to the old log files while it finishes serving old requests. It is therefore necessary to wait for some time after the restart before doing any processing on the log files. A typical scenario that simply rotates the logs and compresses the old logs to save space is:&lt;BR /&gt;&lt;BR /&gt;mv access_log access_log.old&lt;BR /&gt;mv error_log error_log.old&lt;BR /&gt;apachectl graceful&lt;BR /&gt;sleep 600&lt;BR /&gt;gzip access_log.old error_log.old &lt;BR /&gt;&lt;BR /&gt;Rick Retterer&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 27 Feb 2009 00:07:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/logrotate/m-p/4367742#M35389</guid>
      <dc:creator>Rick Retterer</dc:creator>
      <dc:date>2009-02-27T00:07:17Z</dc:date>
    </item>
    <item>
      <title>Re: logrotate</title>
      <link>https://community.hpe.com/t5/operating-system-linux/logrotate/m-p/4367743#M35390</link>
      <description>Try using the rotatelogs function built into Apache, see:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://httpd.apache.org/docs/2.0/programs/rotatelogs.html" target="_blank"&gt;http://httpd.apache.org/docs/2.0/programs/rotatelogs.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;works great for us, you can rotate by time or size.</description>
      <pubDate>Fri, 27 Feb 2009 11:52:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/logrotate/m-p/4367743#M35390</guid>
      <dc:creator>Doug Davenport</dc:creator>
      <dc:date>2009-02-27T11:52:30Z</dc:date>
    </item>
  </channel>
</rss>

