Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Logfile Problem

Posted on 2004-09-03
4
Medium Priority
?
469 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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

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…
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses

610 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