<?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: Creating Multiple syslog.log Versions in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/creating-multiple-syslog-log-versions/m-p/2872366#M98844</link>
    <description>Thanks to all that answered. I did not make a very important point clear. I run a diagnostic program that among other things panics my system peoridically. This may happen at any time of the day and may occur a few times an hour. What I need is a mechanism by which either syslog is copied to a file other than OLDsyslog and the name incremented or that OLDsyslog is copied to a new file before every shutdown.&lt;BR /&gt;&lt;BR /&gt;Again thanks,&lt;BR /&gt;Yosef</description>
    <pubDate>Tue, 31 Dec 2002 13:35:17 GMT</pubDate>
    <dc:creator>Yosef Rosenblatt</dc:creator>
    <dc:date>2002-12-31T13:35:17Z</dc:date>
    <item>
      <title>Creating Multiple syslog.log Versions</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/creating-multiple-syslog-log-versions/m-p/2872361#M98839</link>
      <description>I need to retain more than one previous version of syslog.log. I don???t know the mechanism by which syslog.log is copied/renamed/moved to OLDsyslog.log but it would not matter to me if OLDsyslog is copied/renamed/moved to a new file or the original syslog.log is copied/renamed/moved to a new file. Is there a way this can be done. &lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Yosef Rosenblatt&lt;BR /&gt;</description>
      <pubDate>Tue, 31 Dec 2002 13:11:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/creating-multiple-syslog-log-versions/m-p/2872361#M98839</guid>
      <dc:creator>Yosef Rosenblatt</dc:creator>
      <dc:date>2002-12-31T13:11:08Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Multiple syslog.log Versions</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/creating-multiple-syslog-log-versions/m-p/2872362#M98840</link>
      <description>&lt;A href="http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x2962c1c4ceddd61190050090279cd0f9,00.html" target="_blank"&gt;http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x2962c1c4ceddd61190050090279cd0f9,00.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
      <pubDate>Tue, 31 Dec 2002 13:26:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/creating-multiple-syslog-log-versions/m-p/2872362#M98840</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2002-12-31T13:26:00Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Multiple syslog.log Versions</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/creating-multiple-syslog-log-versions/m-p/2872363#M98841</link>
      <description>Here's a sample script I found:&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;#&lt;BR /&gt;# Roll over the syslogd log files&lt;BR /&gt;#&lt;BR /&gt;&lt;BR /&gt;PATH=/bin:/usr/bin&lt;BR /&gt;&lt;BR /&gt;SYSLOGCONF=/etc/syslog.conf&lt;BR /&gt;PIDFILE=/var/run/syslogd.pid&lt;BR /&gt;OLDDIR=/var/log/.oldlogs&lt;BR /&gt;LIM_SIZE=300&lt;BR /&gt;&lt;BR /&gt;main()&lt;BR /&gt;{&lt;BR /&gt; echo "Rotating syslog log files:"&lt;BR /&gt;&lt;BR /&gt; LOGFILES=`sed -n '&lt;BR /&gt;    /^#/d&lt;BR /&gt;    /^$/d&lt;BR /&gt;   s/[^ ]*[  ]*\(\/.*\)/\1/p' &amp;lt; $SYSLOGCONF  | sort | uniq | egrep -v '^(/dev/|@)'`&lt;BR /&gt;&lt;BR /&gt; for FILE in ${LOGFILES}&lt;BR /&gt; {&lt;BR /&gt;  if [ -f $FILE ]; then&lt;BR /&gt;   eachfile $FILE&lt;BR /&gt;  fi&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt; echo sending SIGHUP to syslogd&lt;BR /&gt; kill -1 `cat $PIDFILE`&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;eachfile()&lt;BR /&gt;{&lt;BR /&gt; size=`sum $1 | awk '{print $2}'`&lt;BR /&gt; if [ $size -ge $LIM_SIZE ]; then&lt;BR /&gt;  echo "Rotating $1 file."&lt;BR /&gt;  roll5 $1&lt;BR /&gt; fi&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;roll()&lt;BR /&gt;{&lt;BR /&gt;  if [ -f "$1" ]; then&lt;BR /&gt;  mv "$1" "$2"&lt;BR /&gt;  fi&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;roll5()&lt;BR /&gt;{&lt;BR /&gt; TAIL=`echo $1 | sed 's/.*\///'`&lt;BR /&gt; OLDLOG="${OLDDIR}/${TAIL}"&lt;BR /&gt;&lt;BR /&gt; roll "$OLDLOG".4 "$OLDLOG".5&lt;BR /&gt; roll "$OLDLOG".3 "$OLDLOG".4&lt;BR /&gt; roll "$OLDLOG".2 "$OLDLOG".3&lt;BR /&gt; roll "$OLDLOG".1 "$OLDLOG".2&lt;BR /&gt; roll "$1"        "$OLDLOG".1&lt;BR /&gt; cp /dev/null $1&lt;BR /&gt; chmod 644 $1&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;main ${1+"$@"}&lt;BR /&gt;exit 0&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry&lt;BR /&gt;</description>
      <pubDate>Tue, 31 Dec 2002 13:28:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/creating-multiple-syslog-log-versions/m-p/2872363#M98841</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2002-12-31T13:28:11Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Multiple syslog.log Versions</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/creating-multiple-syslog-log-versions/m-p/2872364#M98842</link>
      <description>Yosef,&lt;BR /&gt;&lt;BR /&gt;Also, check this recent thread:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x0cd47680e012d71190050090279cd0f9,00.html" target="_blank"&gt;http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x0cd47680e012d71190050090279cd0f9,00.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Tue, 31 Dec 2002 13:29:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/creating-multiple-syslog-log-versions/m-p/2872364#M98842</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2002-12-31T13:29:33Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Multiple syslog.log Versions</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/creating-multiple-syslog-log-versions/m-p/2872365#M98843</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;First thing is to make a backup copy of the /sbin/init.d/syslogd file to syslogd.bak.&lt;BR /&gt;&lt;BR /&gt;edit the syslogd file and change where the syslog.log file is moved to OLDsyslog.log to change it to syslog.log with the date appended to it:&lt;BR /&gt;&lt;BR /&gt;if [ -x /usr/sbin/syslogd -a -f /etc/syslog.conf ]; then&lt;BR /&gt;                if [ -f /var/adm/syslog/syslog.log ]; then&lt;BR /&gt;                 mv /var/adm/syslog/syslog.log /var/adm/syslog/syslog.log.$(date&lt;BR /&gt; +%Y%m%d).$(date +%H%M%S)&lt;BR /&gt;&lt;BR /&gt;Hope this helps&lt;BR /&gt;&lt;BR /&gt;Chris</description>
      <pubDate>Tue, 31 Dec 2002 13:30:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/creating-multiple-syslog-log-versions/m-p/2872365#M98843</guid>
      <dc:creator>Christopher McCray_1</dc:creator>
      <dc:date>2002-12-31T13:30:55Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Multiple syslog.log Versions</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/creating-multiple-syslog-log-versions/m-p/2872366#M98844</link>
      <description>Thanks to all that answered. I did not make a very important point clear. I run a diagnostic program that among other things panics my system peoridically. This may happen at any time of the day and may occur a few times an hour. What I need is a mechanism by which either syslog is copied to a file other than OLDsyslog and the name incremented or that OLDsyslog is copied to a new file before every shutdown.&lt;BR /&gt;&lt;BR /&gt;Again thanks,&lt;BR /&gt;Yosef</description>
      <pubDate>Tue, 31 Dec 2002 13:35:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/creating-multiple-syslog-log-versions/m-p/2872366#M98844</guid>
      <dc:creator>Yosef Rosenblatt</dc:creator>
      <dc:date>2002-12-31T13:35:17Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Multiple syslog.log Versions</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/creating-multiple-syslog-log-versions/m-p/2872367#M98845</link>
      <description>Sorry I forgot to add to the last statement: &lt;BR /&gt;&lt;BR /&gt;For this reason I need something that is not a manual process but is built into the way the o/s handles its shutdown procedures.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;yosef</description>
      <pubDate>Tue, 31 Dec 2002 13:40:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/creating-multiple-syslog-log-versions/m-p/2872367#M98845</guid>
      <dc:creator>Yosef Rosenblatt</dc:creator>
      <dc:date>2002-12-31T13:40:04Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Multiple syslog.log Versions</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/creating-multiple-syslog-log-versions/m-p/2872368#M98846</link>
      <description>Then I don't understand, Yosef, because what I had proposed you do is use the existing statup script.&lt;BR /&gt;&lt;BR /&gt;Every time your system panics and subsequently comes up and starts up syslogd, instead of renaming syslog.log to OLDsyslog.log, it renames it with a unique date/timestamed syslog.log&lt;BR /&gt;&lt;BR /&gt;Hope this clears up my previous post.&lt;BR /&gt;&lt;BR /&gt;Chris</description>
      <pubDate>Tue, 31 Dec 2002 13:44:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/creating-multiple-syslog-log-versions/m-p/2872368#M98846</guid>
      <dc:creator>Christopher McCray_1</dc:creator>
      <dc:date>2002-12-31T13:44:00Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Multiple syslog.log Versions</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/creating-multiple-syslog-log-versions/m-p/2872369#M98847</link>
      <description>You could send your syslog entries to a syslog server, or put a call to that script I gave you in a new shutdown script.&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
      <pubDate>Tue, 31 Dec 2002 13:52:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/creating-multiple-syslog-log-versions/m-p/2872369#M98847</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2002-12-31T13:52:10Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Multiple syslog.log Versions</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/creating-multiple-syslog-log-versions/m-p/2872370#M98848</link>
      <description>Chris,&lt;BR /&gt;I wrote my second question before i read your answer. I just tested it and it works perfectly. Thanks a lot.&lt;BR /&gt;&lt;BR /&gt;Yosef</description>
      <pubDate>Tue, 31 Dec 2002 13:53:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/creating-multiple-syslog-log-versions/m-p/2872370#M98848</guid>
      <dc:creator>Yosef Rosenblatt</dc:creator>
      <dc:date>2002-12-31T13:53:06Z</dc:date>
    </item>
  </channel>
</rss>

