[cod] Log file rotation
josh at chickenmonkey.co.uk
Tue Jan 27 20:16:10 EST 2004
This was something that has come from medal of honour as well as nearly
every other Q3 engine based game .. if you alter the config file your
server stops writing to it.
How often do you need to get it? I update the stats on our server every
24 hours (which requires the logile to be restarted) and just cron a
restart at 7am every morning - if anyones playing at that time they can
cope with 5 minutes of downtime :)
On Tue, 2004-01-27 at 22:53, VG Ops wrote:
> Hmmmm. With or without logsync, a map_restart / map_rotate always
> refreshes the file handle. I can delete the games_mp.log and a
> map_restart will cause it to be recreated.
> I guess it would be possible to write a cron script to use rcon to
> change g_log to a different filename, and if next time it runs, it
> detects that a file with the new file name exists, it can rotate out the
> old one.
> There should be a better way of doing this though.... :-/
> Josh Wright wrote:
> >You'll need logsync set to 1 for this to work. Otherwise it only writes
> >the log at every map_rotate (and writes it slowly for the first few
> >minutes of the new map to avoid lag I guess).
> >It can be used in the cfg file or from the command line.
> >set g_logsync "1"
> >-----Original Message-----
> >From: VG Ops [mailto:info at valuegaming.com]
> >Sent: Tuesday, January 27, 2004 9:56 AM
> >To: cod at icculus.org
> >Subject: [cod] Log file rotation
> >Has anyone had any problems with setting up log file rotation. If find
> >that if I move the games_mp.log file (to say games_mp.1.gz) then CoD
> >does not start a new games_mp.log and wont write to an empty
> >games_mp.log put in its place (a touched file). In fact, the only way I
> >seem able to get cod to start writing to the log is to restart the
> >server. :-(
> >Ideally I'd like to rotate the logs every hour as part of a cron job
> >which also updates the mohstats (I don't want mohstats to keep reading
> >the same data in the file and create duplicate entries in the stats).
> >VG ops
More information about the Cod