<?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 Trimming log files in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/trimming-log-files/m-p/2893139#M103391</link>
    <description>I am trying to trim cron log files which is about 120M&lt;BR /&gt;I am using the following command:&lt;BR /&gt;tail -5000 log &amp;gt; log.old and then the idea is to zero the original log file.&lt;BR /&gt;&lt;BR /&gt;But the tail command takes only the last 365 lines and the same thing happens with the tail -n option. Is there any limitation for the number of lines with the tail command or can any one tell me another method to trim the file</description>
    <pubDate>Thu, 30 Jan 2003 16:19:32 GMT</pubDate>
    <dc:creator>roadrunner_1</dc:creator>
    <dc:date>2003-01-30T16:19:32Z</dc:date>
    <item>
      <title>Trimming log files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/trimming-log-files/m-p/2893139#M103391</link>
      <description>I am trying to trim cron log files which is about 120M&lt;BR /&gt;I am using the following command:&lt;BR /&gt;tail -5000 log &amp;gt; log.old and then the idea is to zero the original log file.&lt;BR /&gt;&lt;BR /&gt;But the tail command takes only the last 365 lines and the same thing happens with the tail -n option. Is there any limitation for the number of lines with the tail command or can any one tell me another method to trim the file</description>
      <pubDate>Thu, 30 Jan 2003 16:19:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/trimming-log-files/m-p/2893139#M103391</guid>
      <dc:creator>roadrunner_1</dc:creator>
      <dc:date>2003-01-30T16:19:32Z</dc:date>
    </item>
    <item>
      <title>Re: Trimming log files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/trimming-log-files/m-p/2893140#M103392</link>
      <description>From man tail:&lt;BR /&gt;&lt;BR /&gt;"Tails relative to end-of-file are stored in a 20-Kbyte buffer, and&lt;BR /&gt;      thus are limited in length."&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Thu, 30 Jan 2003 16:23:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/trimming-log-files/m-p/2893140#M103392</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2003-01-30T16:23:21Z</dc:date>
    </item>
    <item>
      <title>Re: Trimming log files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/trimming-log-files/m-p/2893141#M103393</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;I found this with man tail:&lt;BR /&gt;&lt;BR /&gt;Tails relative to end-of-file are stored in a 20-Kbyte buffer, and&lt;BR /&gt;      thus are limited in length.  Therefore, be wary of the results when&lt;BR /&gt;      piping output from other commands into tail.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Tom</description>
      <pubDate>Thu, 30 Jan 2003 16:25:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/trimming-log-files/m-p/2893141#M103393</guid>
      <dc:creator>Tom Jackson</dc:creator>
      <dc:date>2003-01-30T16:25:50Z</dc:date>
    </item>
    <item>
      <title>Re: Trimming log files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/trimming-log-files/m-p/2893142#M103394</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;As Pete mentioned, there is a buffer limit for 'tail'.  Take a look at these two threads.  I'm pretty sure there are some scripts in there that will take care of log files:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x026250011d20d6118ff40090279cd0f9,00.html" target="_blank"&gt;http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x026250011d20d6118ff40090279cd0f9,00.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x836cc1c4ceddd61190050090279cd0f9,00.html" target="_blank"&gt;http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x836cc1c4ceddd61190050090279cd0f9,00.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;JP&lt;BR /&gt;</description>
      <pubDate>Thu, 30 Jan 2003 16:25:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/trimming-log-files/m-p/2893142#M103394</guid>
      <dc:creator>John Poff</dc:creator>
      <dc:date>2003-01-30T16:25:58Z</dc:date>
    </item>
    <item>
      <title>Re: Trimming log files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/trimming-log-files/m-p/2893143#M103395</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;Yes, 'tail' has definite buffer limitations.  The better choice is to use 'sed' to chop.  Calculate from where you want to delete, for instance with 'wc -l filename' and then do:&lt;BR /&gt;&lt;BR /&gt;# sed -e '1000,$!d' infile &amp;gt; outfile &lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 30 Jan 2003 16:26:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/trimming-log-files/m-p/2893143#M103395</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2003-01-30T16:26:34Z</dc:date>
    </item>
    <item>
      <title>Re: Trimming log files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/trimming-log-files/m-p/2893144#M103396</link>
      <description>Hi (again):&lt;BR /&gt;&lt;BR /&gt;Sorry, I didn't quit finish the above.  I suggested using 'wc -l' to deduce the size of your logfile and then inferred computing some line-number to which you want to trim.  The example I gave was:&lt;BR /&gt;&lt;BR /&gt;# sed -e '1000,$!d' infile &amp;gt; outfile &lt;BR /&gt;&lt;BR /&gt;Obviously, that's OK for static values.  To use a calculated line number, call it "N", change the above to:&lt;BR /&gt;&lt;BR /&gt;# N=1000 #...or whatever, however derived...&lt;BR /&gt;# sed -e "$N,$"!d infile &amp;gt; outfile&lt;BR /&gt;&lt;BR /&gt;...Note the use of double quotes to allow shell expansion.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 30 Jan 2003 16:49:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/trimming-log-files/m-p/2893144#M103396</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2003-01-30T16:49:07Z</dc:date>
    </item>
    <item>
      <title>Re: Trimming log files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/trimming-log-files/m-p/2893145#M103397</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;To just zero the file do&lt;BR /&gt;&lt;BR /&gt;#&amp;gt; /var/adm/cron/log&lt;BR /&gt;&lt;BR /&gt;Note that standard log files can also be trimmed using SAM as follows:&lt;BR /&gt;&lt;BR /&gt;sam -&amp;gt; Routine Tasks -&amp;gt; System Log Files -&amp;gt; highlight /var/adm/cron/log -&amp;gt; Actions -&amp;gt; Trim &lt;BR /&gt;&lt;BR /&gt;And there are several trim options available. You can also set a unique size to key the actions on.&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Jeff</description>
      <pubDate>Thu, 30 Jan 2003 17:45:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/trimming-log-files/m-p/2893145#M103397</guid>
      <dc:creator>Jeff Schussele</dc:creator>
      <dc:date>2003-01-30T17:45:30Z</dc:date>
    </item>
  </channel>
</rss>

