On Wed, 9 Nov 2005, m0gely wrote:
> devin812 wrote:
>
> > Hey Guys,
> >
> > I've looked around for this and i'm sure one of you know the answer, how do
> > I limit the log file size that the server creates, so when it gets to a
> > certain size it will start a new file?
> >
> > I currently have the server on one map only, the log file will normally
> > start over on map change, but with one map only servers the logfile can get
> > huge...
> >
> > Help! and thanks
> > -Some llama
>
> Send the server a 'log off' then tar.gz the log file, then send 'log on'
> again. You could do that on a monthly basis and make a script easily
> enough to automate it.
Actually he just need todo a 'log on' and it will rotate the file.
I have written a script that gzip all the files each month and then save
last month in its own directory to keep the file list short. And there is
no need to use tar if its only one file. 'gzip <filename>' will pack the
file and delete the unpacked file.
basically the script for packing files is:
--
cd /where/you/have/your/logfiledir/
files=`ls *.log | sort`
count=`echo $files | awk '{ print NF }'`
# save 2 files
no=2
for i in $files
do
if [ -f $i -a $no -lt $count ]
then
gzip $i
fi
no=`echo $no | awk '{ a=$1; a++; print a }'`
done
--
Then I have a lot of other stuff to move them to different direcories,
clean up and such.
/Bjorn
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please
visit:
http://list.valvesoftware.com/mailman/listinfo/hlds_linux