LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   logratote drove me to crazy!!!!! (https://www.linuxquestions.org/questions/linux-software-2/logratote-drove-me-to-crazy-87019/)

kingroom 08-29-2003 12:32 PM

logratote drove me to crazy!!!!!
 
I found a command '/usr/sbin/logrotate' running on my machine(redhat 7.3) again and again. every time it eats more than 95% CPU time and runs a long long time! i killed it, but it will run again and again. this nearly drives me out of my mind. who can tell me what's the problem and how to fix it?

Thinks

kingroom 08-29-2003 12:34 PM

the command name should be logrotate, sorry

JoeDuncan 09-10-2003 12:06 PM

Logrotate is a program that will periodically compress or delete your log files so that they don't wind up consuming your entire harddrive.

All the log files is works on are found in /var/log

However, when it takes forever and ever, it is most likely that you have used up most of your harddrive space and it is madly swapping stuff in and out of virtual memory in order to get the job done.

Also, you may have a misconfigured logrotate.

First of all you should do "man logrotate" to learn about logrotate (it is a good thing, trust me).

Then you should do a "df", which will show you how much free space you have on disk. If you disk usage is near 100% you have a problem.

Also, take a look at the logs in /var/log/mail, /var/log/news etc..., sometimes with a misconfigured logrotate it can end up re-compressing the same files over and over again leading to hundreds of files something like this:

mail.1.gz
mail.1.gz.gz
mail.1.gz.gz.gz
mail.1.gz.gz.gz.gz
mail.1.gz.gz.gz.gz.gz...
....etc you get the picture...

Hunt around in your /var/log directory, if you see stuff like this for other logs as well, it's a good bet you have a misconfigured logrotate that is uselessly compressing the same file over and over again.

IIRC, the config file should be: /etc/logrotate.conf or something (there may be a config directory in /etc for logrotate, it should be easy to find...)

Anyways, if logrotate is misconfigured you will need to edit the config file to be more specific (i.e. instead of having it rotate /var/log/mail/mail.*, specify explicitly only the log files you want it to rotate) or to delete logs rather than compress them (if you really don't need a 4 month log trace or whatever...)

If you still need a hand, get back to me...


All times are GMT -5. The time now is 05:16 AM.