<?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 System Administration in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/system-administration/m-p/2427835#M1952</link>
    <description>Is there an easy way to locate and maintain system and application logs so you don't run out of disk space?  I would like to run a cron job to perform this maintenance.&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Tue, 27 Jun 2000 14:07:07 GMT</pubDate>
    <dc:creator>MARIE ELDRIDGE</dc:creator>
    <dc:date>2000-06-27T14:07:07Z</dc:date>
    <item>
      <title>System Administration</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/system-administration/m-p/2427835#M1952</link>
      <description>Is there an easy way to locate and maintain system and application logs so you don't run out of disk space?  I would like to run a cron job to perform this maintenance.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 27 Jun 2000 14:07:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/system-administration/m-p/2427835#M1952</guid>
      <dc:creator>MARIE ELDRIDGE</dc:creator>
      <dc:date>2000-06-27T14:07:07Z</dc:date>
    </item>
    <item>
      <title>Re: System Administration</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/system-administration/m-p/2427836#M1953</link>
      <description>'sam' as an option do to this. just does some of them however.</description>
      <pubDate>Tue, 27 Jun 2000 14:06:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/system-administration/m-p/2427836#M1953</guid>
      <dc:creator>Andy Monks</dc:creator>
      <dc:date>2000-06-27T14:06:01Z</dc:date>
    </item>
    <item>
      <title>Re: System Administration</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/system-administration/m-p/2427837#M1954</link>
      <description>There are many tools out there for this purpose.&lt;BR /&gt;SAM is one good tool to keep on top of this. Also in the porting archive &lt;BR /&gt;is a trimlog binary. You can do the configs for what is to be done and all that good stuff. You could also write a script to do the tasks. Be careful though. some of the log files will need to be handled with care. Example is the syslog.log file. You may want to cp it somewhere then cat /dev/null &amp;gt; syslog.log because it is an open file. You may want to kill -HUP `cat /var/run/syslog.pid` to have it restart as well.</description>
      <pubDate>Tue, 27 Jun 2000 14:22:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/system-administration/m-p/2427837#M1954</guid>
      <dc:creator>Rick Garland</dc:creator>
      <dc:date>2000-06-27T14:22:35Z</dc:date>
    </item>
    <item>
      <title>Re: System Administration</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/system-administration/m-p/2427838#M1955</link>
      <description>YES for example, put this line in your cron file:&lt;BR /&gt;0 08 27 12 * cat /dev/null &amp;gt; /var/adm/wtmp&lt;BR /&gt;&lt;BR /&gt;Cheers!&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 27 Jun 2000 14:29:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/system-administration/m-p/2427838#M1955</guid>
      <dc:creator>CHRIS_ANORUO</dc:creator>
      <dc:date>2000-06-27T14:29:01Z</dc:date>
    </item>
    <item>
      <title>Re: System Administration</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/system-administration/m-p/2427839#M1956</link>
      <description>Assuming all logs end in .log or .LOG&lt;BR /&gt;write a script like this and add it to your cron&lt;BR /&gt;&lt;BR /&gt;find / -depth -print|grep -i .log$ &amp;gt; /tmp/loglist&lt;BR /&gt;&lt;BR /&gt;for X in `cat /tmp/loglist`&lt;BR /&gt;do&lt;BR /&gt;tail -50 $X &amp;gt; /tmp/templog&lt;BR /&gt;rm $X&lt;BR /&gt;mv /tmp/templog $X&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;This is the most simple way&lt;BR /&gt;you should add an if statement making sure /tmp/templog exists before removing and copying over the log file&lt;BR /&gt;&lt;BR /&gt;you can also add -size +2000 to the find&lt;BR /&gt;this will limit the truncating of log files to just large ones&lt;BR /&gt;&lt;BR /&gt;add a line with in the for statement&lt;BR /&gt;&lt;BR /&gt;echo $X &amp;gt;&amp;gt; somefile&lt;BR /&gt;&lt;BR /&gt;to keep a log of what files were clipped&lt;BR /&gt;&lt;BR /&gt;you can also not delete but rename you log files each day&lt;BR /&gt;&lt;BR /&gt;mv $X $X`date "+%m%d%y"`.log&lt;BR /&gt;then after the for statement run another find command&lt;BR /&gt;find / -depth -print -atime +x -exec rm {} /;&lt;BR /&gt;&lt;BR /&gt;x being the number of days old the file deleted should be&lt;BR /&gt;&lt;BR /&gt;i am sure there are more in depth ways to do this for people who script much better than i&lt;BR /&gt;&lt;BR /&gt;and remember use sam for system files its better and much eaiser&lt;BR /&gt;</description>
      <pubDate>Tue, 27 Jun 2000 18:27:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/system-administration/m-p/2427839#M1956</guid>
      <dc:creator>James Odak</dc:creator>
      <dc:date>2000-06-27T18:27:55Z</dc:date>
    </item>
    <item>
      <title>Re: System Administration</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/system-administration/m-p/2427840#M1957</link>
      <description>um when i put in find / blah blah &lt;BR /&gt;i should of said /dir of the dir your application is in &lt;BR /&gt;if you do just / you will get the.log of the system files that sam would take care of for you &lt;BR /&gt;&lt;BR /&gt;sorry &lt;BR /&gt;&lt;BR /&gt;Jim</description>
      <pubDate>Tue, 27 Jun 2000 18:32:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/system-administration/m-p/2427840#M1957</guid>
      <dc:creator>James Odak</dc:creator>
      <dc:date>2000-06-27T18:32:13Z</dc:date>
    </item>
    <item>
      <title>Re: System Administration</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/system-administration/m-p/2427841#M1958</link>
      <description>Thanks everyone for your help.  Sorry I am late in responding, but I was out sick for a while.  I never knew I had so many log files to keep track of.&lt;BR /&gt;&lt;BR /&gt;Thanks again!</description>
      <pubDate>Fri, 14 Jul 2000 16:28:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/system-administration/m-p/2427841#M1958</guid>
      <dc:creator>MARIE ELDRIDGE</dc:creator>
      <dc:date>2000-07-14T16:28:39Z</dc:date>
    </item>
    <item>
      <title>Re: System Administration</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/system-administration/m-p/2427842#M1959</link>
      <description>One thing to watch for in the scripted example: some logs have open file pointers at all times, which means that removing the file and moving another into place will corrupt the pointer reference (meaning you lose logging until the appropriate process is recycled).  A safer way is:&lt;BR /&gt;&lt;BR /&gt;tail -50 $LOGFILE &amp;gt; $TMPFILE&lt;BR /&gt;cat $TMPFILE &amp;gt; $LOGFILE&lt;BR /&gt;&lt;BR /&gt;Note: tailing from the logical EOF is dangerous if you really want to preserve a large chunk of information, since the buffer will only hold 20K.  That shouldn't be a worry for this problem, though.</description>
      <pubDate>Fri, 14 Jul 2000 17:56:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/system-administration/m-p/2427842#M1959</guid>
      <dc:creator>Alan Riggs</dc:creator>
      <dc:date>2000-07-14T17:56:00Z</dc:date>
    </item>
    <item>
      <title>Re: System Administration</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/system-administration/m-p/2427843#M1960</link>
      <description>There are two script samples: dailylogs.sh and weeklylogs.sh located at:&lt;BR /&gt;&lt;BR /&gt;ftp://contrib:9unsupp8@hprc.external.hp.com/sysadmin/cronjobs&lt;BR /&gt;&lt;BR /&gt;The dailylogs script will trim the fast growing files, where weeklylogs will trim a given logfile if it exceeds a set value. Each script is designed to be expanded and modified for local situations.</description>
      <pubDate>Fri, 14 Jul 2000 23:41:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/system-administration/m-p/2427843#M1960</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2000-07-14T23:41:10Z</dc:date>
    </item>
  </channel>
</rss>

