clean logs

rmxs

Verified User
Joined
Jan 14, 2007
Messages
133
Hello how its possible to clean error log files from the services?
 
the only way to clean error logs its manual because after 4 years my apache error log is 100mbs
 
One apache error log 100Mbs? Don't you use any log rotater? newsyslog?
You can delete your logs via shell, it is simple.
 
no i dont use any of this..
when i clear it from shell create again automatically this file?

how can i install newsyslog etc.. ?
 
Hmm... yes, you should recreate them after deleteing, or just clear them without deleting.

e.g.
Code:
#echo > /path/to/your/error/log

What exactly logs do we talk about?
Is it /var/log/httpd/error_log or error logs of your virtual hosts?
If first, the log should be rotated by newsyslog,
if second, directadmin rotate them.

To use newsyslog, check /etc/newsyslog.conf and /etc/crontab, read man newsyslog.conf

You should have line

0 * * * * root newsyslog -a rotate

in /etc/crontab

Directadmin runs /usr/local/directadmin/scripts/newsyslog.sh to add logs for rotating.
 
we talking about /var/log/httpd/error_log exim etc..

[root@servers ~]# /etc/newsyslog.conf
-bash: /etc/newsyslog.conf: No such file or directory

So that means its not on my system..

[root@servers ~]# /usr/local/directadmin/scripts/newsyslog.sh
-bash: /usr/local/directadmin/scripts/newsyslog.sh: No such file or directory
 
2.6.18-53.1.19.el5.028stab053.14ent #1 SMP Thu May 8 21:34:57 MSD 2008 i686 i686 i386 GNU/Linux
 
Back
Top