Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 01-08-2008, 09:54 AM   #1
Registered: Oct 2005
Location: Bangladesh
Posts: 504

Rep: Reputation: 31
Why we use logrotate ?

Dear friends ,

I cannot understand how to use logrotate feature in Linux to read the 'man' file . Plz give me a sample example about it and tell me why it is necessary to use it ?
Old 01-08-2008, 09:59 AM   #2
LQ Sage
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,675

Rep: Reputation: Disabled

Originally Posted by shipon_97 View Post
Why we use logrotate ?

I cannot understand how to use logrotate feature in Linux to read the 'man' file .
Do we?
Old 01-08-2008, 10:05 AM   #3
Registered: Aug 2007
Location: Buffalo, NY
Distribution: Fedora 7, RHEL5, CentOS 5 and Backtrack 2.0
Posts: 73

Rep: Reputation: 15
logrotate performs log rotation and Logrotation is important because the log files that represent the action of 'syslog rules' can grow to a large size very quickly. Logrotate is often installed by default on your linux system, which rotates the logs based on certain criteria. The criteria can be based on size or frequency. Frequency, in turn, can be tied to daily,weekly and so on. Logrotation is performed automatically by the system.

If u want to see how logrotate actually works, then take a gud look at /etc/logrotate.conf file......

Actually depending on the frequency(daily, weekly, hourly or so), the log files keep on rotating. for example if logrotation is set to be done weekly then after 1 week, the picture would be.........

boot.log -> boot.log.1 -> boot.log.2 -> boot.log.3 -> boot.log.4 -> wiped from the disk

where boot.log is a log file.
Old 01-08-2008, 10:27 AM   #4
LQ Guru
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 270Reputation: 270Reputation: 270
man logrotate
Old 01-09-2008, 09:15 AM   #5
Registered: Aug 2006
Distribution: Fedora, CentOS, RHEL, Debian
Posts: 978

Rep: Reputation: 31
Can anybody give me a hint on how to setup a logrotate for fetchmail?

/var/log/fetchmail {     In my case this would be /var/log/fetchmaillog
    rotate 5
    create 640 fetchmail root    Again in my case this would be create 600 fetchmaillog root
        if [ -f /var/run/fetchmail/ ]; then \  again in my case ist would be /var/run/
            if [ -x /usr/sbin/invoke-rc.d ]; then \
                invoke-rc.d fetchmail restart > /dev/null; \
            else \
                /etc/init.d/fetchmail restart > /dev/null; \
            fi; \
So this
is from a debian system. But I am running CentOS 5.1 x86 i386.
I guess that after this
the script performs a restart of fetchmail so.
Can I just apply this to me needs like if.... instead of /usr/sbin/invoke-rc.d to write /usr/bin fetchmail and so on ...
Another thing is that my mails get catched by a cron job like this
/usr/bin/fetchmail -v -k -L /var/log/fetchmaillog -f '/root/.fetchmailrc' >/dev/null 2>&1
is only cause I don't want to have always a mail sent to root afterwards.
So if I would rewrite the script above and then if a pid exists etc.. and I start /usr/bin/fetchmail I guess I will have to attach all those -v -k -L as well ?


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
About logrotate satimis *BSD 1 05-27-2007 01:08 PM
logrotate sidra Red Hat 10 08-01-2006 01:05 AM
Logrotate - did I get it right? Swakoo Linux - General 1 06-20-2006 05:14 AM
Logrotate Help! MaverickApollo Linux - Software 3 02-19-2004 12:09 PM
logrotate Rig24 Linux - Newbie 2 07-11-2003 05:08 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:07 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration