PDA

View Full Version : Log messages



massimomm
4th May 2006, 01:11 PM
Hi at all,
How can i do to delete the logs messages ?
Thanks in advance
Massimo

tashirosgt
4th May 2006, 06:08 PM
Which log are you talking about? There are many in the /var/log directory.

massimomm
5th May 2006, 10:25 AM
You are right !!
I mean the "messages" log file
many thanks !!
Massimo

Lluisanunez
5th May 2006, 10:50 AM
Aren't they in /var/log/messages ?

massimomm
5th May 2006, 11:50 AM
Yes are they !!
How can i do to delete this message ?

Lluisanunez
5th May 2006, 11:58 AM
Why would you want to do that???
Anyway, open a terminal, become root, move to the directory /var/log and remove the files with:
rm <filename>

massimomm
5th May 2006, 12:34 PM
Because the file has a lot of rows !
and the /var partition is 1 MB :(
Thanks

pparks1
5th May 2006, 12:49 PM
/var partition is 1 MB
If this is true, you have a serious problem on your hands.

The system logs everything to /var. In addition, the default location for apache web data is var (/var/www/html), the default for mysql databases is var (/var/lib/mysql), etc.

How did the /var partition get that small? Is it possible that there is only 1MB of free space remaining?

ccrvic
5th May 2006, 12:50 PM
Because the file has a lot of rows !

This is not the way to do it.

Make sure your logrotate job is running

ls /etc/cron.daily/logrotate

And make sure the config is to your liking in /etc/logrotate.conf .


and the /var partition is 1 MB

1MB is *tiny* for /var. I take it you mean 1GB...

You've probably got some big caches in there. What do you get with

du -h -x --max-depth=1 /var

Vic.

massimomm
5th May 2006, 01:15 PM
sorry friends,
i've wrong, the var partition is not 1 MB but 1 GB, but in any case i've problems
because i need more free space !
the logrotate job is not running, i think that this is the only solution !
because only the file message is near to 900 Mb.
if i delete this file, the question is : the 'messages' fille will be created automatically by the system ?

ibbo
5th May 2006, 01:35 PM
Can you not kick of lvm and assign some free space to your /var volume.

ibbo

massimomm
5th May 2006, 01:43 PM
Can you not kick of lvm
Sorry but what does means kick of lvm ?

Seve
5th May 2006, 01:47 PM
sorry friends,
i've wrong, the var partition is not 1 MB but 1 GB, but in any case i've problems
because i need more free space !
the logrotate job is not running, i think that this is the only solution !
because only the file message is near to 900 Mb.
if i delete this file, the question is : the 'messages' fille will be created automatically by the system ?
Hello:
Your logs will continue to grow in size if crond is not running and by default the logs are rotated every 4 weeks. The crond service is what controls this. If you wish to rotate your logs every 1 or 2 weeks, which will reduce the size you need to edit your /etc/logrotat.conf file and change the rotate 4 to rotate X and of course have crond configured to run.
hth
Seve

massimomm
5th May 2006, 03:31 PM
Thanks very much !!
this is that i have to do !!
but if i change the rotation logs from 4 to 1 week ,in this case the old log will be automatically deleted ?

Seve
5th May 2006, 05:35 PM
Thanks very much !!
this is that i have to do !!
but if i change the rotation logs from 4 to 1 week ,in this case the old log will be automatically deleted ?
Hello:
From the man logrotate :
If you change the rotate to 1 it will rotate one time before being deleted. Which I think means you will always have at least 2 logs..one current and one old. If you change it to 0, then you will have only the current as no old log file will be created.
It will rotate and compress the log (if you add the neccessary option to compress in your logrotate.conf file) on a weekly basis and on the next rotation it will be erased.
Or, If you can set the option to rotate on a daily basis if you wish.
Just open up a terminal and type man logrotate and it explains the options etc. much better than I can.
hth

Seve

massimomm
10th May 2006, 10:06 AM
I just do it, reading the man lagrotate,
and i've solved my original problem, by setting the logrotate to 0 !
Thanks you all !
Massimo