<?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: shell script for log rotation in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-for-log-rotation/m-p/3703013#M688665</link>
    <description>As opposed to size, the logrotate does it job based on time.&lt;BR /&gt;&lt;BR /&gt;Once per week, per month, daily, etc...&lt;BR /&gt;&lt;BR /&gt;I like to rotate by month - I keep the previous 2 months on the system with older logs being on 2 different monthly backups. &lt;BR /&gt;&lt;BR /&gt;Each will have a name that describes its contents and from when. Example, 'sulog.Dec2005', 'sulog.Nov2005', 'syslog.Dec2005', etc...&lt;BR /&gt;&lt;BR /&gt;I know the time frames so I know which archived log file to look for.</description>
    <pubDate>Thu, 05 Jan 2006 10:40:49 GMT</pubDate>
    <dc:creator>Rick Garland</dc:creator>
    <dc:date>2006-01-05T10:40:49Z</dc:date>
    <item>
      <title>shell script for log rotation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-for-log-rotation/m-p/3703009#M688661</link>
      <description>Dear Sirs,&lt;BR /&gt;&lt;BR /&gt;I want to rotate a log file based on its size. Does anyone has any shell script for this ?&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Shiv</description>
      <pubDate>Thu, 05 Jan 2006 01:55:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-for-log-rotation/m-p/3703009#M688661</guid>
      <dc:creator>Shivkumar</dc:creator>
      <dc:date>2006-01-05T01:55:28Z</dc:date>
    </item>
    <item>
      <title>Re: shell script for log rotation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-for-log-rotation/m-p/3703010#M688662</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt;do u have logrotate:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://hpux.connect.org.uk/hppd/hpux/Sysadmin/logrotate-2.5/" target="_blank"&gt;http://hpux.connect.org.uk/hppd/hpux/Sysadmin/logrotate-2.5/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;regards.</description>
      <pubDate>Thu, 05 Jan 2006 02:00:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-for-log-rotation/m-p/3703010#M688662</guid>
      <dc:creator>Joseph Loo</dc:creator>
      <dc:date>2006-01-05T02:00:18Z</dc:date>
    </item>
    <item>
      <title>Re: shell script for log rotation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-for-log-rotation/m-p/3703011#M688663</link>
      <description>hi shiv,&lt;BR /&gt;&lt;BR /&gt;see:&lt;BR /&gt;&lt;A href="http://hpux.connect.org.uk/hppd/hpux/Sysadmin/logrotate-2.5/" target="_blank"&gt;http://hpux.connect.org.uk/hppd/hpux/Sysadmin/logrotate-2.5/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;this tool 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;hope this helps!&lt;BR /&gt;&lt;BR /&gt;kind regards&lt;BR /&gt;yogeeraj</description>
      <pubDate>Thu, 05 Jan 2006 02:09:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-for-log-rotation/m-p/3703011#M688663</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2006-01-05T02:09:39Z</dc:date>
    </item>
    <item>
      <title>Re: shell script for log rotation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-for-log-rotation/m-p/3703012#M688664</link>
      <description>Use logrotate - link above.&lt;BR /&gt;&lt;BR /&gt;Mine is configured like so:&lt;BR /&gt;&lt;BR /&gt;/etc/logrotate.conf&lt;BR /&gt;&lt;BR /&gt;# see "man logrotate" for details&lt;BR /&gt;# rotate log files weekly&lt;BR /&gt;weekly&lt;BR /&gt;&lt;BR /&gt;# keep 4 weeks worth of backlogs&lt;BR /&gt;rotate 5&lt;BR /&gt;&lt;BR /&gt;# create new (empty) log files after rotating old ones&lt;BR /&gt;create&lt;BR /&gt;&lt;BR /&gt;# uncomment this if you want your log files compressed&lt;BR /&gt;#compress&lt;BR /&gt;&lt;BR /&gt;# packages drop log rotation information into this directory&lt;BR /&gt;include /etc/logrotate.d&lt;BR /&gt;&lt;BR /&gt;# no packages own wtmp -- we'll rotate them here&lt;BR /&gt;/var/adm/wtmp {&lt;BR /&gt;    monthly&lt;BR /&gt;    create 0664 adm adm&lt;BR /&gt;    rotate 1&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;In /etc/logrotate.d dir, I have maillog and syslog.&lt;BR /&gt;&lt;BR /&gt;# cat syslog&lt;BR /&gt;/var/adm/syslog/syslog.log {&lt;BR /&gt;    rotate 5&lt;BR /&gt;    weekly&lt;BR /&gt;    postrotate&lt;BR /&gt;        /usr/bin/kill -HUP `ps -ef |grep syslogd |awk '{print $2}'` || true&lt;BR /&gt;    endscript&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;# cat maillog&lt;BR /&gt;/var/adm/syslog/mail.log {&lt;BR /&gt;          rotate 5&lt;BR /&gt;          weekly&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Rgds...Geoff</description>
      <pubDate>Thu, 05 Jan 2006 09:46:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-for-log-rotation/m-p/3703012#M688664</guid>
      <dc:creator>Geoff Wild</dc:creator>
      <dc:date>2006-01-05T09:46:55Z</dc:date>
    </item>
    <item>
      <title>Re: shell script for log rotation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-for-log-rotation/m-p/3703013#M688665</link>
      <description>As opposed to size, the logrotate does it job based on time.&lt;BR /&gt;&lt;BR /&gt;Once per week, per month, daily, etc...&lt;BR /&gt;&lt;BR /&gt;I like to rotate by month - I keep the previous 2 months on the system with older logs being on 2 different monthly backups. &lt;BR /&gt;&lt;BR /&gt;Each will have a name that describes its contents and from when. Example, 'sulog.Dec2005', 'sulog.Nov2005', 'syslog.Dec2005', etc...&lt;BR /&gt;&lt;BR /&gt;I know the time frames so I know which archived log file to look for.</description>
      <pubDate>Thu, 05 Jan 2006 10:40:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-for-log-rotation/m-p/3703013#M688665</guid>
      <dc:creator>Rick Garland</dc:creator>
      <dc:date>2006-01-05T10:40:49Z</dc:date>
    </item>
    <item>
      <title>Re: shell script for log rotation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-for-log-rotation/m-p/3703014#M688666</link>
      <description>Hi Shiv, &lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=938732" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=938732&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;-Arun</description>
      <pubDate>Thu, 05 Jan 2006 22:44:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-for-log-rotation/m-p/3703014#M688666</guid>
      <dc:creator>Arunvijai_4</dc:creator>
      <dc:date>2006-01-05T22:44:28Z</dc:date>
    </item>
    <item>
      <title>Re: shell script for log rotation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-for-log-rotation/m-p/3703015#M688667</link>
      <description>Hi Shiv, &lt;BR /&gt;If you prefer a shell script, here a good ksh script found on this forum some time ago.(Sorry, I forgot the name of the author). It rotate log files based on size, lifespan, It allow compression, manage the "old" files log generated by the system (eg OLDsyslog.log vs syslog.log), the number of copies to maintain, the security parameters to be applied to the files with chmod and chown. It is very simple, easy to adapt and deserves to be examined.&lt;BR /&gt;Regards, Joel</description>
      <pubDate>Fri, 06 Jan 2006 04:35:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-for-log-rotation/m-p/3703015#M688667</guid>
      <dc:creator>Joel Girot</dc:creator>
      <dc:date>2006-01-06T04:35:04Z</dc:date>
    </item>
    <item>
      <title>Re: shell script for log rotation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-for-log-rotation/m-p/3703016#M688668</link>
      <description>Hi All,&lt;BR /&gt;&lt;BR /&gt;Just want to say that the attached script by Joel above works very well in our hpux system. &lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;BR /&gt;Michael&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 16 Oct 2008 21:49:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-for-log-rotation/m-p/3703016#M688668</guid>
      <dc:creator>Michael Mendoza</dc:creator>
      <dc:date>2008-10-16T21:49:59Z</dc:date>
    </item>
  </channel>
</rss>

