Posted on 2004-09-03
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?