<?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: Looking for commands in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/looking-for-commands/m-p/3729654#M789110</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;more comfortable tools are "logrotate" and "logadm".&lt;BR /&gt;&lt;BR /&gt;Don't know if they are available as binaries for HPUX, you might need to get Linux source and compile on your own.&lt;BR /&gt;&lt;BR /&gt;Esp. logadm has a ton of options to do nice things in logfile administration. I.e. restart the process which is writing the file.&lt;BR /&gt;&lt;BR /&gt;Zeroing out a logfile as described above is easy and comfortable, but if you have a monitoring process on that logfile (i.e "tail -f") you may loose messages, because you will have to restart this monitoring process in addition. "logadm" is a very comfortable way to do this.&lt;BR /&gt;&lt;BR /&gt;Volker&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Sun, 12 Feb 2006 03:53:12 GMT</pubDate>
    <dc:creator>Volker Borowski</dc:creator>
    <dc:date>2006-02-12T03:53:12Z</dc:date>
    <item>
      <title>Looking for commands</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/looking-for-commands/m-p/3729650#M789106</link>
      <description>Hey people, i was looking for some commands.&lt;BR /&gt;&lt;BR /&gt;1). How would u trim log files. &lt;BR /&gt;2). How do u find files which are most new?&lt;BR /&gt;3). How do u find files which are using the most space?&lt;BR /&gt;&lt;BR /&gt;thanks alot.</description>
      <pubDate>Sat, 11 Feb 2006 19:51:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/looking-for-commands/m-p/3729650#M789106</guid>
      <dc:creator>khilari</dc:creator>
      <dc:date>2006-02-11T19:51:39Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for commands</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/looking-for-commands/m-p/3729651#M789107</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;1.  The best way to empty a log file is simply:&lt;BR /&gt;&lt;BR /&gt;# cat /dev/null &amp;gt; logfile&lt;BR /&gt;&lt;BR /&gt;2.  To find files that are newer (more recently modified than some time):&lt;BR /&gt;&lt;BR /&gt;# find /yourpath -xdev -type f -mtime +30&lt;BR /&gt;&lt;BR /&gt;...this finds files in /yourpath that havn't been modified in the last 30-days&lt;BR /&gt;&lt;BR /&gt;# touch -amt 02110000 /tmp/myref&lt;BR /&gt;# find /yourpath -xdev -type f -newer /tmp/myref&lt;BR /&gt;&lt;BR /&gt;...this form finds files that are newer than the reference file /tmp/myref&lt;BR /&gt;&lt;BR /&gt;3.  To find files greater than a particular size:&lt;BR /&gt;&lt;BR /&gt;# find /yourpatch -xdev -type f -size +100000c&lt;BR /&gt;&lt;BR /&gt;...returns files whose size exceeds 100,000 characters.&lt;BR /&gt;&lt;BR /&gt;# du -xak /yourpath | sort -k1nr&lt;BR /&gt;&lt;BR /&gt;...return all files and directories in /yourpath and list them in descending block (1K size) order.&lt;BR /&gt;&lt;BR /&gt;The manpages for 'find' and for 'du' should be read with these examples in mind.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Sat, 11 Feb 2006 20:11:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/looking-for-commands/m-p/3729651#M789107</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-02-11T20:11:48Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for commands</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/looking-for-commands/m-p/3729652#M789108</link>
      <description>Hi Khilari,&lt;BR /&gt;&lt;BR /&gt;Q1). How would u trim log files. &lt;BR /&gt;&lt;BR /&gt;Ans : # &amp;gt;/var/adm/syslog/syslog.log will trim syslog.log file&lt;BR /&gt;&lt;BR /&gt;Q2). How do u find files which are most new?&lt;BR /&gt;&lt;BR /&gt;Ans : #  find . -type f -ctime -1 -exec ll {} \;&lt;BR /&gt;&lt;BR /&gt;Q3). How do u find files which are using the most space?&lt;BR /&gt;&lt;BR /&gt;# ls -lR | sort +4 -5nr | more&lt;BR /&gt;&lt;BR /&gt;-Arun</description>
      <pubDate>Sun, 12 Feb 2006 03:06:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/looking-for-commands/m-p/3729652#M789108</guid>
      <dc:creator>Arunvijai_4</dc:creator>
      <dc:date>2006-02-12T03:06:41Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for commands</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/looking-for-commands/m-p/3729653#M789109</link>
      <description>Shalom Khilari,&lt;BR /&gt;&lt;BR /&gt;I have several ways I handle this.&lt;BR /&gt;&lt;BR /&gt;On some servers, I manually trim using sam.&lt;BR /&gt;&lt;BR /&gt;On most servers, I weekly back up the log files and do this command on the ones I wish cut down:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; logfilename&lt;BR /&gt;&lt;BR /&gt;This second method is totally done via cron.&lt;BR /&gt;&lt;BR /&gt;/var/adm/btmp and /var/adm/wtmp take up a lot of space, as do mail.log and syslog.log. The first two are critical for security. If you don't keep them, you will have problems on a Security audit.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Sun, 12 Feb 2006 03:36:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/looking-for-commands/m-p/3729653#M789109</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2006-02-12T03:36:53Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for commands</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/looking-for-commands/m-p/3729654#M789110</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;more comfortable tools are "logrotate" and "logadm".&lt;BR /&gt;&lt;BR /&gt;Don't know if they are available as binaries for HPUX, you might need to get Linux source and compile on your own.&lt;BR /&gt;&lt;BR /&gt;Esp. logadm has a ton of options to do nice things in logfile administration. I.e. restart the process which is writing the file.&lt;BR /&gt;&lt;BR /&gt;Zeroing out a logfile as described above is easy and comfortable, but if you have a monitoring process on that logfile (i.e "tail -f") you may loose messages, because you will have to restart this monitoring process in addition. "logadm" is a very comfortable way to do this.&lt;BR /&gt;&lt;BR /&gt;Volker&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sun, 12 Feb 2006 03:53:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/looking-for-commands/m-p/3729654#M789110</guid>
      <dc:creator>Volker Borowski</dc:creator>
      <dc:date>2006-02-12T03:53:12Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for commands</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/looking-for-commands/m-p/3729655#M789111</link>
      <description>Hi;&lt;BR /&gt;&lt;BR /&gt;Try this..&lt;BR /&gt;&lt;BR /&gt;1 #cat /dev/null /&lt;PATH&gt;(e.g. /dev/adm/wtmp)&lt;BR /&gt;&lt;BR /&gt;2 #find / -type f -mtime +24 -print&lt;BR /&gt;&lt;BR /&gt;3 #find / -type f -size +100000c &lt;BR /&gt;&lt;BR /&gt;3 #du -sk /&lt;PATH&gt; |sort -rn&lt;BR /&gt;&lt;BR /&gt;Cheers&lt;BR /&gt;indrajit&lt;/PATH&gt;&lt;/PATH&gt;</description>
      <pubDate>Sun, 12 Feb 2006 13:35:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/looking-for-commands/m-p/3729655#M789111</guid>
      <dc:creator>Indrajit_1</dc:creator>
      <dc:date>2006-02-12T13:35:07Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for commands</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/looking-for-commands/m-p/3729656#M789112</link>
      <description>1). How would u trim log files.&lt;BR /&gt;&lt;BR /&gt;Simply as,&lt;BR /&gt;&lt;BR /&gt;&amp;gt; Logfile &lt;BR /&gt;&lt;BR /&gt;will do it. Else use sam to trim logs.&lt;BR /&gt;&lt;BR /&gt;2). How do u find files which are most new?&lt;BR /&gt;&lt;BR /&gt;# find / -xdev -type f -mtime -1&lt;BR /&gt;&lt;BR /&gt;which will give today's update file. Change with + &lt;DAYS&gt; to get more files within that time period.&lt;BR /&gt;&lt;BR /&gt;3). How do u find files which are using the most space?&lt;BR /&gt;&lt;BR /&gt;# du -ks &lt;PATH&gt; | sort -rnk 1 | more&lt;BR /&gt;&lt;BR /&gt;will give it.&lt;BR /&gt;&lt;BR /&gt;--&lt;BR /&gt;Muthu&lt;/PATH&gt;&lt;/DAYS&gt;</description>
      <pubDate>Mon, 13 Feb 2006 01:39:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/looking-for-commands/m-p/3729656#M789112</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2006-02-13T01:39:10Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for commands</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/looking-for-commands/m-p/3729657#M789113</link>
      <description>I use sam to trim the files, as mentioned in an earlier post.&lt;BR /&gt;Routine Tasks-&amp;gt; System Log Files-&amp;gt; select files to trim.&lt;BR /&gt;The one thing that you need to keep in mind is that if the file is on use that you are trying to trim a backup is created with an extension SAMTRM of at the end of the file name. You'll need to delete this file if you are looking to gain space.&lt;BR /&gt;&lt;BR /&gt;I don;t know how familar you are with the different "trim" commands mentioned above, but most will create a new file with no records. Make sure that is what you want.  &lt;BR /&gt;&lt;BR /&gt;Richard</description>
      <pubDate>Mon, 13 Feb 2006 09:05:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/looking-for-commands/m-p/3729657#M789113</guid>
      <dc:creator>Richard Darling</dc:creator>
      <dc:date>2006-02-13T09:05:12Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for commands</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/looking-for-commands/m-p/3729658#M789114</link>
      <description>You can get logrotate here:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://hpux.ee.ualberta.ca/hppd/hpux/Sysadmin/logrotate-2.5/" target="_blank"&gt;http://hpux.ee.ualberta.ca/hppd/hpux/Sysadmin/logrotate-2.5/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Others have answered your questions - so I won't repeat them.&lt;BR /&gt;&lt;BR /&gt;Rgds...Geoff</description>
      <pubDate>Mon, 13 Feb 2006 09:37:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/looking-for-commands/m-p/3729658#M789114</guid>
      <dc:creator>Geoff Wild</dc:creator>
      <dc:date>2006-02-13T09:37:19Z</dc:date>
    </item>
  </channel>
</rss>

