Raised This Month: $32 Target: $400
 8% 

Automatic delete logs?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
$n1p3r
Member
Join Date: Feb 2010
Old 04-29-2010 , 12:14   Automatic delete logs?
Reply With Quote #1

Hello!

Is it possible to make to delete cstrike/logs automaticaly?

Thanks ;)
$n1p3r is offline
Send a message via MSN to $n1p3r Send a message via Skype™ to $n1p3r
kanatzu
Veteran Member
Join Date: Oct 2007
Location: Sweden
Old 04-29-2010 , 13:54   Re: Automatic delete logs?
Reply With Quote #2

Yeah, it's possible!

But how, no clue!
__________________




Quote:
Originally Posted by wrecked_ View Post
Stop saying words before I sodomize you with a cucumber.
kanatzu is offline
Send a message via MSN to kanatzu
atom0s
Senior Member
Join Date: Jul 2009
Old 04-29-2010 , 18:19   Re: Automatic delete logs?
Reply With Quote #3

Just turn off logging if you don't plan to look at them. Think the command is:

Code:
log 0
Haven't touched hlds in a while. Some others to disable too:

mp_logmessages 0mp_logfile 0
mp_logdetail 0
atom0s is offline
$n1p3r
Member
Join Date: Feb 2010
Old 04-29-2010 , 18:49   Re: Automatic delete logs?
Reply With Quote #4

I'm using logs for generating statistics for players, but I would like to know is it possible to delete like 5-6 days old logs?

Maybe some cron job or something?
$n1p3r is offline
Send a message via MSN to $n1p3r Send a message via Skype™ to $n1p3r
pizzahut
Senior Member
Join Date: Oct 2004
Old 05-01-2010 , 07:30   Re: Automatic delete logs?
Reply With Quote #5

Yes you can set up a cron job for it. Try this, it'll be executed at 4am every day. It deletes all log files older than 30 days. Standard output (if any) will be saved to find_out.txt, errors (if any) will be saved to find_err.txt.
Code:
EDITOR=/bin/nano
crontab -e
0 4 * * * find ~ -mtime +30 -name *.log -type f -exec rm {} \; > ~/find_out.txt 2> ~/find_err.txt
  • Replace with the editor with one of your choice, nano might not even be installed on your system.
  • If ~ for the home directory doesn't work, try $HOME instead. Or use the full path, e.g. /home/sniper instead of ~.
  • You might need to add the path to find, so /usr/bin/find instead of find.
__________________
My AMXX plugins (content date 2007-03-29, link check 2017-04-26)

Plugins for the Royston Vasey TFC server - These are UNSUPPORTED, except those which have been published at AMX Mod X.

Last edited by pizzahut; 05-02-2010 at 11:13. Reason: Replaced script with a single command.
pizzahut is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 18:36.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode