<?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: delete record in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/delete-record/m-p/4285462#M335992</link>
    <description>You either need a perl script that does date arithmetic, or you need to do the work yourself.&lt;BR /&gt;&lt;BR /&gt;See caljd script in:&lt;BR /&gt;&lt;A href="http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1173649" target="_blank"&gt;http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1173649&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=213185" target="_blank"&gt;http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=213185&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;After you get the date for 2 months ago, you could use sed to remove up to that date:&lt;BR /&gt;sed "1,\\:$OLD_DATE: d" log</description>
    <pubDate>Mon, 13 Oct 2008 05:09:57 GMT</pubDate>
    <dc:creator>Dennis Handly</dc:creator>
    <dc:date>2008-10-13T05:09:57Z</dc:date>
    <item>
      <title>delete record</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/delete-record/m-p/4285460#M335990</link>
      <description>I have a log file , that keep the record of system activities , as below , now the log is appending so that it becomes very large .&lt;BR /&gt;&lt;BR /&gt;"&lt;BR /&gt;05/01/08 Normal userA &lt;BR /&gt;05/01/08 Normal userB&lt;BR /&gt;05/02/08 Alnormal userC&lt;BR /&gt;"&lt;BR /&gt;"&lt;BR /&gt;10/01/08 Normal userA &lt;BR /&gt;10/02/08 Normal userA &lt;BR /&gt;"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Now I would like to keep the log current , so if the date is over 60 days , then remove this row , like above , the first three row should be removed as 05/01/08 and 05/02/08 is over 60 days ( today is 10/08/08 ) , can advise how to do it ? thx</description>
      <pubDate>Mon, 13 Oct 2008 04:43:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/delete-record/m-p/4285460#M335990</guid>
      <dc:creator>haeman</dc:creator>
      <dc:date>2008-10-13T04:43:56Z</dc:date>
    </item>
    <item>
      <title>Re: delete record</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/delete-record/m-p/4285461#M335991</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt;did you look into LOGROTATE?&lt;BR /&gt;&lt;BR /&gt;Quote from Man logrotate:&lt;BR /&gt;&lt;BR /&gt;logrotate  is designed to ease administration of systems that generate large numbers of log files.  It allows  automatic  rotation,  compression, removal, and mailing of log files.  Each log file may be handled daily, weekly, monthly, or when it grows too large.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;if your requirements are not that strict, you may wish to implement this.&lt;BR /&gt;&lt;BR /&gt;hope this helps!&lt;BR /&gt;kind regards&lt;BR /&gt;yogeeraj&lt;BR /&gt;</description>
      <pubDate>Mon, 13 Oct 2008 05:05:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/delete-record/m-p/4285461#M335991</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2008-10-13T05:05:23Z</dc:date>
    </item>
    <item>
      <title>Re: delete record</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/delete-record/m-p/4285462#M335992</link>
      <description>You either need a perl script that does date arithmetic, or you need to do the work yourself.&lt;BR /&gt;&lt;BR /&gt;See caljd script in:&lt;BR /&gt;&lt;A href="http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1173649" target="_blank"&gt;http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1173649&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=213185" target="_blank"&gt;http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=213185&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;After you get the date for 2 months ago, you could use sed to remove up to that date:&lt;BR /&gt;sed "1,\\:$OLD_DATE: d" log</description>
      <pubDate>Mon, 13 Oct 2008 05:09:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/delete-record/m-p/4285462#M335992</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2008-10-13T05:09:57Z</dc:date>
    </item>
    <item>
      <title>Re: delete record</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/delete-record/m-p/4285463#M335993</link>
      <description>thx replies,&lt;BR /&gt;&lt;BR /&gt;LOGROTATE could do the requirement , it could check the date ( eg. 05/02/08 ) in the log ? thx</description>
      <pubDate>Mon, 13 Oct 2008 05:31:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/delete-record/m-p/4285463#M335993</guid>
      <dc:creator>haeman</dc:creator>
      <dc:date>2008-10-13T05:31:58Z</dc:date>
    </item>
    <item>
      <title>Re: delete record</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/delete-record/m-p/4285464#M335994</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt;Please read the docs.&lt;BR /&gt;&lt;BR /&gt;e.g.&lt;BR /&gt;Please see:&lt;BR /&gt;&lt;A href="http://www.debian-administration.org/articles/117" target="_blank"&gt;http://www.debian-administration.org/articles/117&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;With logrotate, you will have to define the rules as per the specifications. I think it is better to implement something more generic.&lt;BR /&gt;&lt;BR /&gt;otherwise you can implement the solution provided by Dennis above.&lt;BR /&gt;&lt;BR /&gt;kind regards&lt;BR /&gt;yogeeraj</description>
      <pubDate>Mon, 13 Oct 2008 05:43:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/delete-record/m-p/4285464#M335994</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2008-10-13T05:43:59Z</dc:date>
    </item>
    <item>
      <title>Re: delete record</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/delete-record/m-p/4285465#M335995</link>
      <description>thx reply ,&lt;BR /&gt;&lt;BR /&gt;I tried the script in the link &lt;BR /&gt;&lt;A href="http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=213185" target="_blank"&gt;http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=213185&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;but I have some problem when run it in my distro . &lt;BR /&gt;&lt;BR /&gt;I have read the man page of logrotate , I think the below part is function works for my case , but I am not too understand how it fit to my requirement , could advise do I need to write the script to make it ? thx&lt;BR /&gt;&lt;BR /&gt;     /var/log/news/news.crit {&lt;BR /&gt;           monthly&lt;BR /&gt;           rotate 2&lt;BR /&gt;           olddir /var/log/news/old&lt;BR /&gt;           missingok&lt;BR /&gt;           postrotate&lt;BR /&gt;                                     kill -HUP ?ç  at /var/run/inn.pid??&lt;BR /&gt;           endscript&lt;BR /&gt;           nocompress&lt;BR /&gt;       }&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 14 Oct 2008 08:42:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/delete-record/m-p/4285465#M335995</guid>
      <dc:creator>haeman</dc:creator>
      <dc:date>2008-10-14T08:42:46Z</dc:date>
    </item>
    <item>
      <title>Re: delete record</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/delete-record/m-p/4285466#M335996</link>
      <description>thx reply ,&lt;BR /&gt;&lt;BR /&gt;can advise what can i do ?</description>
      <pubDate>Wed, 15 Oct 2008 23:38:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/delete-record/m-p/4285466#M335996</guid>
      <dc:creator>haeman</dc:creator>
      <dc:date>2008-10-15T23:38:20Z</dc:date>
    </item>
  </channel>
</rss>

