this is the script i use for running the stats and archiving the game logs for my cod2 ctf server. it doesn&#39;t clear out the console log, but i trust that the same method can be applied. just echo &gt; logfile.<br><br>#!/bin/sh
<br><br>SERVER=ctf<br>BASEDIR=~/$SERVER<br>MODNAME=ax&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # mod name or &quot;main&quot;<br>LOGFILE=$BASEDIR/$MODNAME/game.log<br>LOGDIR=$BASEDIR/logs<br>DATE=`date +%Y_%m_%d-%H:%M`<br>MOHSTATS=~/bin/mohstats
<br><br># Copy the log file and erase the original<br>if [ -e $LOGDIR/game_logs ]<br>&nbsp; then<br>&nbsp;&nbsp;&nbsp; echo &quot;# log dir exists...&quot;<br>&nbsp; else<br>&nbsp;&nbsp;&nbsp; echo &quot;# creating log dir...&quot;<br>&nbsp;&nbsp;&nbsp; mkdir -p $LOGDIR/game_logs
<br>fi<br><br>grep say $LOGFILE &gt; $LOGDIR/$DATE.chat<br>cp $LOGFILE $LOGDIR/game_logs/$DATE.log<br>echo &gt; $LOGFILE<br><br># Run the stats<br>cd $MOHSTATS<br>nice -9 /usr/bin/php -q mohstats_$SERVER.php $LOGDIR/game_logs/$DATE.log
<br><br>if [ -e ~/public_html/stats/$SERVER ]<br>&nbsp; then<br>&nbsp;&nbsp;&nbsp; echo &quot;# stats web dir exists...&quot;<br>&nbsp; else<br>&nbsp;&nbsp;&nbsp; echo &quot;# creating stats web dir...&quot;<br>&nbsp;&nbsp;&nbsp; mkdir -p ~/public_html/stats/$SERVER<br>fi<br>
<br># copy the cache file over<br>cp $MOHSTATS/cache_$SERVER ~/public_html/stats/$SERVER/<br><br># archive the log file<br>nice -9 gzip $LOGDIR/game_logs/$DATE.log<br><br>echo &quot;# done&quot;<br><br><br><div class="gmail_quote">
On Jan 14, 2008 1:15 PM, RG GR &lt;<a href="mailto:aquariusrick@hotmail.com">aquariusrick@hotmail.com</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">




<div><br>My 2 cents....<br><br>That&#39;s the beauty of a Linux OS, so you shouldn&#39;t have to schedule restarts (unless your running Microsoft......).<br><br>It seems there should be a configuration setting for MAXIMUM_LOGFILE_SIZE, which archives the logfile and creates a new one so you don&#39;t HAVE to restart your server at 5am.
<br><br><blockquote><hr>Date: Mon, 14 Jan 2008 09:02:45 -0500<br>From: <a href="mailto:dax.douglass@gmail.com" target="_blank">dax.douglass@gmail.com</a><br>To: <a href="mailto:cod@icculus.org" target="_blank">cod@icculus.org
</a><div class="Ih2E3d"><br>Subject: Re: [cod] server up too long?<br><br>Geoff,<br><br>How do you clear the game log with the server running?&nbsp; I wanted to do the same thing myself, but was afraid it may cause some issues.
<br><br><div>On Jan 14, 2008 8:44 AM, Geoff Goas &lt;<a href="mailto:gitman@gmail.com" target="_blank">
gitman@gmail.com</a>&gt; wrote:<br><blockquote style="padding-left: 1ex;">game logs can be cleared out without having to restart the server. if i can maintain the same uptime on my cod2 server and not experience these issues, then the same should go for cod4.
<div><div></div><div><br><br>
<div>On Jan 14, 2008 6:40 AM, Jon Adams &lt;<a href="mailto:dooku@ner-clan.net" target="_blank">dooku@ner-clan.net</a>&gt; wrote:<br>
<blockquote style="padding-left: 1ex;">Somethings aren&#39;t bugs, they are just &quot;the way things are&quot; unfortunately not every cockroach can be snuffed out.
<br>And if a clan is playing a match at 5am they need to discover the outside! 
<div>
<div></div>
<div><br><br>
<div><span>On 14/01/2008, <b>Dubravszky József</b> &lt;<a href="mailto:mail@joed.hu" target="_blank">mail@joed.hu</a>&gt; wrote:</span> 
<blockquote style="padding-left: 1ex;">
<div>
<div><font face="Arial" size="2">Well, we all know setting up a cron job is not a big deal for this method. But restarting periodically is not a fair thing. What if a team is actually playing matches @ 5 AM? Anyway I think the better way is to find and fix the bug.
</font></div>
<blockquote style="padding-right: 0px; padding-left: 5px; margin-left: 5px; margin-right: 0px;"><span>
<div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal;">----- Original Message ----- </div>
<div style="background: rgb(228, 228, 228) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal;">

<b>From:</b> <a title="dooku@ner-clan.net" href="mailto:dooku@ner-clan.net" target="_blank">Jon Adams</a> </div>

<div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal;"><b>To:</b> <a title="cod@icculus.org" href="mailto:cod@icculus.org" target="_blank">
cod@icculus.org</a> </div></span>
<div><span>
<div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal;"><b>Sent:</b> Monday, January 14, 2008 9:52 AM
</div>
<div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal;"><b>Subject:</b> Re: [cod] server up too long?
</div>
<div><br></div>Good practice you should really restart you&#39;re server periodically, reduce game log sizes &amp; knocks out any errors. I&#39;m sure there are more experienced people here that can advise on a linux program that will schedule this for you, but a 5am restart will alleviate these kinds of troubles :) 
<br><br></span></div></blockquote></div></blockquote></div></div></div></blockquote></div></div></div></blockquote></div><br></div></blockquote><br><hr>Get the power of Windows + Web with the new Windows Live. <a href="http://www.windowslive.com?ocid=TXT_TAGHM_Wave2_powerofwindows_012008" target="_blank">
Get it now!</a></div>
</blockquote></div><br><br clear="all"><br>-- <br>Geoff Goas<br>IT Specialist, <a href="http://www.goastech.com">http://www.goastech.com</a><br>Administrator, <a href="http://www.anarchic-x.com">http://www.anarchic-x.com
</a>