<?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: Syslog purging in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/syslog-purging/m-p/5172941#M682154</link>
    <description>You could do it manually in vi(1).&lt;BR /&gt;Or you could use sed:&lt;BR /&gt;sed -e '/Apr 1/,$p/' syslog.log &amp;gt; syslog.latest&lt;BR /&gt;&lt;BR /&gt;You'll need to find the exact format for Apr 1 from the syslog file.</description>
    <pubDate>Mon, 04 May 2009 05:57:56 GMT</pubDate>
    <dc:creator>Dennis Handly</dc:creator>
    <dc:date>2009-05-04T05:57:56Z</dc:date>
    <item>
      <title>Syslog purging</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/syslog-purging/m-p/5172940#M682153</link>
      <description>Hi all&lt;BR /&gt;&lt;BR /&gt;My syslog file is too large. I want to copy the lines by date wise like "Apr 1 to May 4".&lt;BR /&gt;&lt;BR /&gt;Please suggest me.</description>
      <pubDate>Mon, 04 May 2009 04:33:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/syslog-purging/m-p/5172940#M682153</guid>
      <dc:creator>Jeeshan</dc:creator>
      <dc:date>2009-05-04T04:33:54Z</dc:date>
    </item>
    <item>
      <title>Re: Syslog purging</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/syslog-purging/m-p/5172941#M682154</link>
      <description>You could do it manually in vi(1).&lt;BR /&gt;Or you could use sed:&lt;BR /&gt;sed -e '/Apr 1/,$p/' syslog.log &amp;gt; syslog.latest&lt;BR /&gt;&lt;BR /&gt;You'll need to find the exact format for Apr 1 from the syslog file.</description>
      <pubDate>Mon, 04 May 2009 05:57:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/syslog-purging/m-p/5172941#M682154</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2009-05-04T05:57:56Z</dc:date>
    </item>
    <item>
      <title>Re: Syslog purging</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/syslog-purging/m-p/5172942#M682155</link>
      <description>Hi,&lt;BR /&gt;just copy the file into other name &lt;BR /&gt;#cd /var/adm/syslog&lt;BR /&gt;#cp syslog.log syslog.old&lt;BR /&gt;vi syslog.old  &lt;BR /&gt;go to the desire line&lt;BR /&gt;press Esc :,$d&lt;BR /&gt;it will remove all below lines from the cursor position.&lt;BR /&gt;&lt;BR /&gt;Suraj</description>
      <pubDate>Mon, 04 May 2009 07:23:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/syslog-purging/m-p/5172942#M682155</guid>
      <dc:creator>Suraj K Sankari</dc:creator>
      <dc:date>2009-05-04T07:23:20Z</dc:date>
    </item>
    <item>
      <title>Re: Syslog purging</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/syslog-purging/m-p/5172943#M682156</link>
      <description>HI:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; I want to copy the lines by date wise like "Apr 1 to May 4".&lt;BR /&gt;&lt;BR /&gt;This suggests that these are the lines you actually want to _preserve_ in your 'syslog'.&lt;BR /&gt;&lt;BR /&gt;You could simply 'vi' the current '/var/adm/syslog/syslog.log' deleting everything before this range begins.&lt;BR /&gt;&lt;BR /&gt;You could, as Dennis suggested, use something like 'sed' to match and print lines in that region to a new file.&lt;BR /&gt;&lt;BR /&gt;If you chose to redirect output to a new file, like 'syslog.latest' or 'syslog.new' and then wish to _replace_ the contents of the "real" syslog file with it:&lt;BR /&gt;&lt;BR /&gt;Do _NOT_ use 'mv' to replace the old file with the new file.  Instead, use 'cp' to keep the current file associated with the current 'syslogd' process.  If you erroneously 'mv' a new file over the old one, you will find that further logging will not occur until you restart the 'syslogd' daemon.&lt;BR /&gt;&lt;BR /&gt;If you examine the "start" action of '/sbin/init.d/syslogd' you will see that a restart of the 'syslogd' daemon is made following a 'mv' [rename] of the current 'syslog' to 'OLDsyslog'.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 04 May 2009 10:08:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/syslog-purging/m-p/5172943#M682156</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-05-04T10:08:31Z</dc:date>
    </item>
    <item>
      <title>Re: Syslog purging</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/syslog-purging/m-p/5172944#M682157</link>
      <description>thnx all&lt;BR /&gt;</description>
      <pubDate>Mon, 04 May 2009 10:27:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/syslog-purging/m-p/5172944#M682157</guid>
      <dc:creator>Jeeshan</dc:creator>
      <dc:date>2009-05-04T10:27:20Z</dc:date>
    </item>
    <item>
      <title>Re: Syslog purging</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/syslog-purging/m-p/5172945#M682158</link>
      <description>&amp;gt;sed -e '/Apr  1/,$p/' syslog.log &amp;gt; syslog.latest&lt;BR /&gt;&amp;gt;ME: You'll need to find the exact format for Apr 1 from the syslog file.&lt;BR /&gt;&lt;BR /&gt;Oops, slight problem, that should have a -n!&lt;BR /&gt;&lt;BR /&gt;In mine, there is one space after the month and for one digit dates, there is an extra space.&lt;BR /&gt;&lt;BR /&gt;I assume you don't have to worry about no syslog entries for Apr 1?  ;-)&lt;BR /&gt;&lt;BR /&gt;For partial months, you could use:&lt;BR /&gt;sed -n -e '/^Apr /,$p/' syslog.log&lt;BR /&gt;&lt;BR /&gt;This picks the first entry for April, even if you rebooted on Apr 15.</description>
      <pubDate>Tue, 05 May 2009 01:36:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/syslog-purging/m-p/5172945#M682158</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2009-05-05T01:36:22Z</dc:date>
    </item>
    <item>
      <title>Re: Syslog purging</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/syslog-purging/m-p/5172946#M682159</link>
      <description>Oops another typo: sed -n -e '/^Apr /,$p' syslog.log</description>
      <pubDate>Tue, 05 May 2009 01:39:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/syslog-purging/m-p/5172946#M682159</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2009-05-05T01:39:40Z</dc:date>
    </item>
    <item>
      <title>Re: Syslog purging</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/syslog-purging/m-p/5172947#M682160</link>
      <description>thnx Denis</description>
      <pubDate>Tue, 05 May 2009 03:32:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/syslog-purging/m-p/5172947#M682160</guid>
      <dc:creator>Jeeshan</dc:creator>
      <dc:date>2009-05-05T03:32:49Z</dc:date>
    </item>
  </channel>
</rss>

