<?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: rotating syslog in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/rotating-syslog/m-p/2825294#M87444</link>
    <description>For rotating syslogs you must use logrotate . It is a product designed for this. &lt;BR /&gt;&lt;BR /&gt;For finding the bigger 20 files in a directory : &lt;BR /&gt;&lt;BR /&gt;ll /your/directory | sort -r -k 5 | awk -v i=20 '{ if ( i&amp;gt;0 ) print $0 ; i=i-1 }'&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Tibi Baraboi</description>
    <pubDate>Mon, 14 Oct 2002 13:58:35 GMT</pubDate>
    <dc:creator>Tibi Baraboi_1</dc:creator>
    <dc:date>2002-10-14T13:58:35Z</dc:date>
    <item>
      <title>rotating syslog</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/rotating-syslog/m-p/2825291#M87441</link>
      <description>Anyone have a good working script for rotating syslog.  And find the 20 largest files in a directory.  Scripting is not my strong point.</description>
      <pubDate>Mon, 14 Oct 2002 13:49:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/rotating-syslog/m-p/2825291#M87441</guid>
      <dc:creator>Eric Hess</dc:creator>
      <dc:date>2002-10-14T13:49:20Z</dc:date>
    </item>
    <item>
      <title>Re: rotating syslog</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/rotating-syslog/m-p/2825292#M87442</link>
      <description>To rotate the syslog after reboots without overwriting older logs:&lt;BR /&gt;&lt;BR /&gt;1.Make a back up copy of the /sbin/init.d/syslogd file in a temporary location.&lt;BR /&gt;2.Edit the file  /sbin/init.d/syslogd&lt;BR /&gt;# vi /sbin/init.d/syslogd&lt;BR /&gt;3.Locate the line for the ???start??? case. Inside the logic for the start case, there should be a command line of the form&lt;BR /&gt; mv /var/adm/syslog/syslog.log /var/adm/syslog/OLDsyslog.log&lt;BR /&gt;4.Change this line to&lt;BR /&gt; mv /var/adm/syslog/syslog.log /var/adm/syslog/OLDsyslog.log.`date +%b%d%Y_%H%M`&lt;BR /&gt;5.Save the file&lt;BR /&gt;:wq!&lt;BR /&gt;6.During the next reboot, verify that the previous syslog.log in the /var/adm/syslog directory is being backed up as OLDsyslog.log.MDY_HM and not as OLDsyslog.log, where M is the abbreviated month name, D is the date, Y is the year in century format, H is the hour (in 24 hour format) and M is the minute. &lt;BR /&gt;7.During multiple reboots, the old syslog files will thus be saved separately each time and not get overwritten. The /var filesystem must therefore be watched for disk space usage over a period of time.&lt;BR /&gt;&lt;BR /&gt;This concludes the task for changing the /sbin/init.d/syslogd file to save old syslog.log files over multiple reboots.&lt;BR /&gt;&lt;BR /&gt;Backout:&lt;BR /&gt;1.Restore the /sbin/init.d/syslogd file from the temporary location where it was stored in Step 1 of the above Procedure.&lt;BR /&gt;2.During a subsequent reboot of the server, verify that /var/adm/syslog.log is being backed up as /var/adm/syslog/OLDsyslog.log.&lt;BR /&gt;</description>
      <pubDate>Mon, 14 Oct 2002 13:53:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/rotating-syslog/m-p/2825292#M87442</guid>
      <dc:creator>Robert Gamble</dc:creator>
      <dc:date>2002-10-14T13:53:46Z</dc:date>
    </item>
    <item>
      <title>Re: rotating syslog</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/rotating-syslog/m-p/2825293#M87443</link>
      <description>20 largest files,&lt;BR /&gt;&lt;BR /&gt;ll |sort -r -k5,5 |head -n 20&lt;BR /&gt;&lt;BR /&gt;Share and Enjoy! Ian</description>
      <pubDate>Mon, 14 Oct 2002 13:54:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/rotating-syslog/m-p/2825293#M87443</guid>
      <dc:creator>Ian Dennison_1</dc:creator>
      <dc:date>2002-10-14T13:54:59Z</dc:date>
    </item>
    <item>
      <title>Re: rotating syslog</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/rotating-syslog/m-p/2825294#M87444</link>
      <description>For rotating syslogs you must use logrotate . It is a product designed for this. &lt;BR /&gt;&lt;BR /&gt;For finding the bigger 20 files in a directory : &lt;BR /&gt;&lt;BR /&gt;ll /your/directory | sort -r -k 5 | awk -v i=20 '{ if ( i&amp;gt;0 ) print $0 ; i=i-1 }'&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Tibi Baraboi</description>
      <pubDate>Mon, 14 Oct 2002 13:58:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/rotating-syslog/m-p/2825294#M87444</guid>
      <dc:creator>Tibi Baraboi_1</dc:creator>
      <dc:date>2002-10-14T13:58:35Z</dc:date>
    </item>
    <item>
      <title>Re: rotating syslog</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/rotating-syslog/m-p/2825295#M87445</link>
      <description>&lt;A href="http://hpux.cs.utah.edu/hppd/hpux/Sysadmin/logrotate-2.5/" target="_blank"&gt;http://hpux.cs.utah.edu/hppd/hpux/Sysadmin/logrotate-2.5/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
      <pubDate>Mon, 14 Oct 2002 14:05:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/rotating-syslog/m-p/2825295#M87445</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2002-10-14T14:05:34Z</dc:date>
    </item>
    <item>
      <title>Re: rotating syslog</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/rotating-syslog/m-p/2825296#M87446</link>
      <description>&lt;BR /&gt;I like to break up the syslog facilities into separate log files. The syslog.conf will look like this:&lt;BR /&gt;&lt;BR /&gt;kern.debug /var/adm/syslog/kern.log&lt;BR /&gt;user.debug /var/adm/syslog/user.log&lt;BR /&gt;mail.debug /var/adm/syslog/mail.log&lt;BR /&gt;daemon.debug /var/adm/syslog/daemon.log&lt;BR /&gt;auth.debug /var/adm/syslog/auth.log&lt;BR /&gt;syslog.debug /var/adm/syslog/syslog.log&lt;BR /&gt;lpr.debug /var/adm/syslog/lpr.log&lt;BR /&gt;news.debug /var/adm/syslog/news.log&lt;BR /&gt;uucp.debug /var/adm/syslog/uucp.log&lt;BR /&gt;cron.debug /var/adm/syslog/cron.log&lt;BR /&gt;local0.debug /var/adm/syslog/local0.log&lt;BR /&gt;local1.debug /var/adm/syslog/local1.log&lt;BR /&gt;local2.debug /var/adm/syslog/local2.log&lt;BR /&gt;local3.debug /var/adm/syslog/local3.log&lt;BR /&gt;local4.debug /var/adm/syslog/local4.log&lt;BR /&gt;local5.debug /var/adm/syslog/local5.log&lt;BR /&gt;local6.debug /var/adm/syslog/local6.log&lt;BR /&gt;local7.debug /var/adm/syslog/local7.log&lt;BR /&gt;*.emerg *&lt;BR /&gt;*.alert root&lt;BR /&gt;&lt;BR /&gt;I use a posix shell script to locate each log file in a specified directory, move it into a date structured tree (.../OLD/facility/YYYY/MM/DD.HHMMSS), touch a new log file, and send SIGHUP to syslogd when all files have been rotated. The script is attached. It is run by root cron one minute before midnight every day.&lt;BR /&gt;</description>
      <pubDate>Mon, 14 Oct 2002 19:02:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/rotating-syslog/m-p/2825296#M87446</guid>
      <dc:creator>Jordan Bean</dc:creator>
      <dc:date>2002-10-14T19:02:56Z</dc:date>
    </item>
    <item>
      <title>Re: rotating syslog</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/rotating-syslog/m-p/2825297#M87447</link>
      <description>20 biggest files:&lt;BR /&gt;&lt;BR /&gt;big:&lt;BR /&gt;#!/sbin/sh &lt;BR /&gt;du -sk $1 | sort -rn | head -20&lt;BR /&gt;#The End.&lt;BR /&gt;&lt;BR /&gt;example:&lt;BR /&gt;$ big *og*&lt;BR /&gt;10611   XtermLog.23068&lt;BR /&gt;4845    XtermLog.16187&lt;BR /&gt;3583    XtermLog.20340&lt;BR /&gt;2898    XtermLog.01600&lt;BR /&gt;369     XtermLog.24973&lt;BR /&gt;330     XtermLog.23379&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 15 Oct 2002 07:29:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/rotating-syslog/m-p/2825297#M87447</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2002-10-15T07:29:28Z</dc:date>
    </item>
    <item>
      <title>Re: rotating syslog</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/rotating-syslog/m-p/2825298#M87448</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;See on this link:&lt;BR /&gt;&lt;A href="http://www.introcomp.co.uk/examples/index.html" target="_blank"&gt;http://www.introcomp.co.uk/examples/index.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;lots of examples.&lt;BR /&gt;&lt;BR /&gt;C.</description>
      <pubDate>Tue, 15 Oct 2002 07:33:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/rotating-syslog/m-p/2825298#M87448</guid>
      <dc:creator>Clemens van Everdingen</dc:creator>
      <dc:date>2002-10-15T07:33:21Z</dc:date>
    </item>
    <item>
      <title>Re: rotating syslog</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/rotating-syslog/m-p/2825299#M87449</link>
      <description>Here's what I run in a weekly script.  It copies the syslog file to a weekly file and zero's out the syslog.log.  I would recommend against moving the syslog.log as in my experience the syslogd will start copying to the place where you moved the syslog.log to.&lt;BR /&gt;&lt;BR /&gt;datetest=`date +%A`&lt;BR /&gt;date=Friday &lt;BR /&gt;if [[ $datetest = $date ]]&lt;BR /&gt;then&lt;BR /&gt;cp /var/adm/syslog/syslog.log /var/adm/syslog/syslog.log`date '+%d.%m.%y_%H:%M'`&lt;BR /&gt;&amp;gt;/var/adm/syslog/syslog.log&lt;BR /&gt;echo "-------------The syslog has been moved and reduced------------------" &amp;gt;&amp;gt; datafile&lt;BR /&gt;</description>
      <pubDate>Tue, 15 Oct 2002 16:32:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/rotating-syslog/m-p/2825299#M87449</guid>
      <dc:creator>Phillip Renner</dc:creator>
      <dc:date>2002-10-15T16:32:15Z</dc:date>
    </item>
  </channel>
</rss>

