Jump to content

server.log auto-cleanup feature


carv

Recommended Posts

I looked in the documentation but I could not find if there is a way to make the server.log file auto- clean up or purge itself every so often. I am not sure if this is a cvar setting but i did find that g_logs is not included in the documentation nor on the wiki. unless i am blind which is entirely possible.

 

My server.log file is at 29MBytes and am just curious if i have to purge it manually or if there is a mechanism in place to take care of it.

 

For that fact i did not see anything similar to that for admin.log nor cheat.log but these two are so much smaller than server.log.

 

I see where i can use g_logOption to define paramaters to include or exclude but that is it.

Link to comment
Share on other sites

I can do that. i'Il delete it every so often. I was just not sure if there was a way to automatically clean it up or keep the latest 7 days of data or restrict the size to a certain limit.

 

Thanks Blackops!

Link to comment
Share on other sites

Better way would be making new serwer log after one week/month and old serwer log save as xxserver.log (number of month/week where xx is). I'm doing this manualy on my serwer 'couse sometimes i need check some things from last month in server log and i need backups of old log's file.
Link to comment
Share on other sites

For Example:

-- Sol (www.polish-frags.pl)
logname = "serverlog.log"
data = "12:00:00" - rm log every day at 12:00
function et_RunFrame( levelTime )
if string.find(os.date(), data) ~= nil then
 if et.HOSTARCH == "UNIX" then
  os.execute(string.format("rm %s/%s/%s",tostring(et.trap_Cvar_Get("fs_homepath")),tostring(et.trap_Cvar_Get("fs_game")),logname))
 elseif et.HOSTARCH == "WIN32" then
  os.execute(string.format("DEL %s/%s/%s",tostring(et.trap_Cvar_Get("fs_homepath")),tostring(et.trap_Cvar_Get("fs_game")),logname))
 end
end
end

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...