PDA

View Full Version : Automatically restart logfile


PapaSmurf
03-15-2008, 11:25 AM
Hello all, I need some help!

I'm running a number of popular COD4 servers, and have UltraStats running on all of them. The trouble is, UltraStats uploads the log files to our website, where the stats are generated off them.
Basically, this means that each night the log files from all our servers are uploaded, with some of them approaching 2Gb in size!

What I'd like to do, is have monthly stats. So each month, the log file gets deleted and a new one is built. I just can't figure out how to do that - without stopping the server and deleting the log file!
Seems COD4 keeps the log file 'in use' and Windows Server 2003 doesn't deleting files in use!

Anyone got any ideas?

theMechanic
03-15-2008, 02:32 PM
i never heard of an auto restart on the logfiles, someone might know a trick tho.

fkrdiscostu
03-26-2008, 07:26 AM
I know in FireDaemon you can schedule an automatic stop of a server. Then you can place a time delay for restart. If you can coordinate the time between shutdown and log file download, you might get it to work.

mMiniImManN
03-26-2008, 07:44 PM
Hello all, I need some help!

I'm running a number of popular COD4 servers, and have UltraStats running on all of them. The trouble is, UltraStats uploads the log files to our website, where the stats are generated off them.
Basically, this means that each night the log files from all our servers are uploaded, with some of them approaching 2Gb in size!

What I'd like to do, is have monthly stats. So each month, the log file gets deleted and a new one is built. I just can't figure out how to do that - without stopping the server and deleting the log file!
Seems COD4 keeps the log file 'in use' and Windows Server 2003 doesn't deleting files in use!

Anyone got any ideas?


your best bet is to call g_log "newlogname.log" and then wait like.. 30 mins? and then it makes a new log file, releasing the old one.. it's a pain in the ass but it works. Otherwise, you're SOL unless you constantly nag activision for an update to have a better log feature.
we get over gig size logs every week, wish there was a kick ass way to deal with them :s

OldDog
03-27-2008, 03:11 PM
The old ServerStat program had this feature. You could schedule it to run, say, nightly, and it had code built-in that would stop the game, rename the log, and start the game, then FTP the newly renamed logfile to a system for processing. I absolutely loved it. Never had to worry about huge logfiles, and my stats were always u p to date. This was for CoD, CoDUO, and CoD2. It was renamed to Stativore due to a naming conflict, but I still used it. When CoD4 came out, though, a bunch of stuff in the logfiles, and the game itself, changed such that the original code wouldn't work very well. There's a couple of guys in Europe (UK, I think), Delerium and Hebbian who are trying to convert the program to CoD4. I was keeping track for awhile, and actually have one of their Betas running, but the auto-scheduling and renaming features weren't included as yet, so, every once in awhile, I go out to their site (stativore.com), and check to see if they've gotten any farther. It's been awhile since I was last out there. I noticed that there's a Delerium member now, here on FPS...is that you?

The only reason I went through all that explanation is to tell you that it's probably going to take a 3rd-party to do a log swap like you're talking about. Maybe the Stativore guys will do so again.