?
Solved

Logfile Problem

Posted on 2004-09-03
4
Medium Priority
?
467 Views
Last Modified: 2013-12-15
Hi,

I run a games server on mandrake linux (mohaa) and it generates a log file which is written to /root/.mohaa/main/qconsole.log.

at 5am, I run a stats program that parses the log file and generates html output files that are published on the web.

Currently, the only way to reset that log after it has been parsed is to shutdown the games server and start it again, as this clears the log file. If I delete the logfile while the game server is running, it stops appending to the log file. if I run the following command:

echo "" > /root/.mohaa/main/qconsole.log

the file size remains the same, but the text is unreadable apart from the stuff that is appended to it afterwards.

My question is, how can I clear this logfile without restarting the server and without stopping the game server appending to it?

Many Thanks
0
Comment
Question by:vibale
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 18

Expert Comment

by:liddler
ID: 11971424
cat /dev/null >/root/.mohaa/main/qconsole.log
or maybe kill -1 on the servers pid
0
 

Author Comment

by:vibale
ID: 11971491
cat /dev/null >/root/.mohaa/main/qconsole.log does the same as the echo "" >/root/.mohaa/main/qconsole.log

kill -1 pid killed the game server!!
0
 
LVL 2

Accepted Solution

by:
kevincasey earned 1000 total points
ID: 11973122
if you're trying to get daily log files, you might be able to use a program such as cronolog (http://cronolog.org/).  if your server supports logging to a named pipe, you can get a directory full of qconsoleYYYYMMDD.log files.
0
 
LVL 1

Expert Comment

by:HollyRidge
ID: 12044689
Most linux servers normally come with an application called logrotate. I would suggest setting it up to rotate the logs for your game server within it. The config file can normally be found at /etc/logrotate.conf. Hope that helps.
0

Featured Post

Get proactive database performance tuning online

At Percona’s web store you can order full Percona Database Performance Audit in minutes. Find out the health of your database, and how to improve it. Pay online with a credit card. Improve your database performance now!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses
Course of the Month15 days, 6 hours left to enroll

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question