<?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: log rotation by command  &amp;gt; in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/log-rotation-by-command-gt/m-p/3604466#M823720</link>
    <description>The full procedure to "rotate" a logfile is something like: -&lt;BR /&gt;&lt;BR /&gt;cp /var/adm/syslog/syslog.log /var/adm/syslog/syslog.log.`date +%d%m%y`&lt;BR /&gt;&amp;gt; /var/adm/syslog/syslog.log&lt;BR /&gt;&lt;BR /&gt;This copies the contents of the file to a dated file then empties the existing log.  You would probably also compress the dated log.&lt;BR /&gt;&lt;BR /&gt;The reason you can't just move the file is that because the file is open (by the syslog daemon in this case), the file even though renamed still gets written to.&lt;BR /&gt;&lt;BR /&gt;A process when opening a file attaches to the inode (underlying pointer), so when you rename a file the inode remains the same.</description>
    <pubDate>Tue, 16 Aug 2005 05:11:45 GMT</pubDate>
    <dc:creator>Simon Hargrave</dc:creator>
    <dc:date>2005-08-16T05:11:45Z</dc:date>
    <item>
      <title>log rotation by command  &gt;</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/log-rotation-by-command-gt/m-p/3604460#M823714</link>
      <description>Why most of the log files gets rotated using the command "&amp;gt; logfilename" ?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Shiv</description>
      <pubDate>Tue, 16 Aug 2005 04:37:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/log-rotation-by-command-gt/m-p/3604460#M823714</guid>
      <dc:creator>Shivkumar</dc:creator>
      <dc:date>2005-08-16T04:37:26Z</dc:date>
    </item>
    <item>
      <title>Re: log rotation by command  &gt;</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/log-rotation-by-command-gt/m-p/3604461#M823715</link>
      <description>Shiv,&lt;BR /&gt;the &amp;gt; logfilename is a redirect of output command.&lt;BR /&gt;Please clarify your question.</description>
      <pubDate>Tue, 16 Aug 2005 04:39:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/log-rotation-by-command-gt/m-p/3604461#M823715</guid>
      <dc:creator>Peter Godron</dc:creator>
      <dc:date>2005-08-16T04:39:53Z</dc:date>
    </item>
    <item>
      <title>Re: log rotation by command  &gt;</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/log-rotation-by-command-gt/m-p/3604462#M823716</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt;that do not rotate the log file (or any file for that matter). it will "null" or empty the file, i.e. create a zero-length file.&lt;BR /&gt;&lt;BR /&gt;# man null&lt;BR /&gt; for more info.&lt;BR /&gt;&lt;BR /&gt;regards.</description>
      <pubDate>Tue, 16 Aug 2005 04:41:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/log-rotation-by-command-gt/m-p/3604462#M823716</guid>
      <dc:creator>Joseph Loo</dc:creator>
      <dc:date>2005-08-16T04:41:11Z</dc:date>
    </item>
    <item>
      <title>Re: log rotation by command  &gt;</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/log-rotation-by-command-gt/m-p/3604463#M823717</link>
      <description>I think he is talking about using the same name of logfiles after sometimes.&lt;BR /&gt;&lt;BR /&gt;Well,&lt;BR /&gt;With time logfiles become very large in size and slowly they can occupy your whole filesystem.&lt;BR /&gt;&lt;BR /&gt;So its a good convention after sometime you start using the same logfile.</description>
      <pubDate>Tue, 16 Aug 2005 04:46:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/log-rotation-by-command-gt/m-p/3604463#M823717</guid>
      <dc:creator>Vibhor Kumar Agarwal</dc:creator>
      <dc:date>2005-08-16T04:46:46Z</dc:date>
    </item>
    <item>
      <title>Re: log rotation by command  &gt;</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/log-rotation-by-command-gt/m-p/3604464#M823718</link>
      <description>Hi,&lt;BR /&gt;"&amp;gt; logfilename" is truncating, not rotating (all previous information is lost).&lt;BR /&gt;&lt;BR /&gt;Some logfiles is "rotated" (old file renamed and a new created) automatic at reboot or login (e.g. the syslog.log or the $HOME/.dt/startlog).</description>
      <pubDate>Tue, 16 Aug 2005 05:06:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/log-rotation-by-command-gt/m-p/3604464#M823718</guid>
      <dc:creator>Leif Halvarsson_2</dc:creator>
      <dc:date>2005-08-16T05:06:11Z</dc:date>
    </item>
    <item>
      <title>Re: log rotation by command  &gt;</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/log-rotation-by-command-gt/m-p/3604465#M823719</link>
      <description>Hi,&lt;BR /&gt;Do not get confused as Leif mentionned &amp;gt; will overwrite what was there previously to append to you would need &amp;gt;&amp;gt;&lt;BR /&gt;&lt;BR /&gt;Now as for rotating logs you would use your own custum scripts or tool like logrotate:&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;All the best&lt;BR /&gt;Victor</description>
      <pubDate>Tue, 16 Aug 2005 05:11:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/log-rotation-by-command-gt/m-p/3604465#M823719</guid>
      <dc:creator>Victor BERRIDGE</dc:creator>
      <dc:date>2005-08-16T05:11:31Z</dc:date>
    </item>
    <item>
      <title>Re: log rotation by command  &gt;</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/log-rotation-by-command-gt/m-p/3604466#M823720</link>
      <description>The full procedure to "rotate" a logfile is something like: -&lt;BR /&gt;&lt;BR /&gt;cp /var/adm/syslog/syslog.log /var/adm/syslog/syslog.log.`date +%d%m%y`&lt;BR /&gt;&amp;gt; /var/adm/syslog/syslog.log&lt;BR /&gt;&lt;BR /&gt;This copies the contents of the file to a dated file then empties the existing log.  You would probably also compress the dated log.&lt;BR /&gt;&lt;BR /&gt;The reason you can't just move the file is that because the file is open (by the syslog daemon in this case), the file even though renamed still gets written to.&lt;BR /&gt;&lt;BR /&gt;A process when opening a file attaches to the inode (underlying pointer), so when you rename a file the inode remains the same.</description>
      <pubDate>Tue, 16 Aug 2005 05:11:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/log-rotation-by-command-gt/m-p/3604466#M823720</guid>
      <dc:creator>Simon Hargrave</dc:creator>
      <dc:date>2005-08-16T05:11:45Z</dc:date>
    </item>
    <item>
      <title>Re: log rotation by command  &gt;</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/log-rotation-by-command-gt/m-p/3604467#M823721</link>
      <description>I don't think this will works.&lt;BR /&gt;&lt;BR /&gt;I have a file open for writing then simply doing a cat terminates that process.&lt;BR /&gt;&lt;BR /&gt;Here you truncating the whole file which is still open.</description>
      <pubDate>Tue, 16 Aug 2005 05:19:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/log-rotation-by-command-gt/m-p/3604467#M823721</guid>
      <dc:creator>Vibhor Kumar Agarwal</dc:creator>
      <dc:date>2005-08-16T05:19:14Z</dc:date>
    </item>
    <item>
      <title>Re: log rotation by command  &gt;</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/log-rotation-by-command-gt/m-p/3604468#M823722</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;---&amp;gt;I have a file open for writing then simply doing a cat terminates that process.&lt;BR /&gt;&lt;BR /&gt;Not in every case. Sometimes even when you remove the file , the process will keep on. Also it will not release the blocks occupied by such file and the process needs to be terminated manually if you need to get the free space.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;logfilename works for any file you need to null out and not only for the logfiles. This redirects the null to the content of the file, inturn making it a zero byte file.&lt;BR /&gt;&lt;BR /&gt;The samething will be achived by 0&amp;gt;filename.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Devender</description>
      <pubDate>Tue, 16 Aug 2005 07:55:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/log-rotation-by-command-gt/m-p/3604468#M823722</guid>
      <dc:creator>Devender Khatana</dc:creator>
      <dc:date>2005-08-16T07:55:14Z</dc:date>
    </item>
  </channel>
</rss>

