Re: Logrotate - daily log files for a month

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2007-08-23 at 16:15 +0100, John Horne wrote:
> On Thu, 2007-08-23 at 09:58 -0500, Mikkel L. Ellertson wrote:
> > John Horne wrote:
> > > Hello,
> > > 
> > > Using Fedora 7, I am trying to see how we can rotate some log files each
> > > day, but keep a month's worth of files.
> > > 
> > > Logrotate can rotate the files daily, and I can specify something like:
> > > 
> > >    daily
> > >    start 1
> > >    rotate 30
> > > 
> > > But this does not account for month's of 31 days, or February with 28/29
> > > days. Likewise if I set 'rotate 31' then this is not going to work on
> > > those months of just 30 days.
> > > 
> > > Does anyone have any ideas about this?
> > > 
> > > 
> > > Thanks,
> > > 
> > > John.
> > > 
> > You can control how many old log files are kept by changing "rotate
> > 4" to how many weeks of backlogs you want to keep, This is in
> > /etc/logrotate.conf. You can control individual logs by editing the
> > corresponding file in /etc/logrotate.d and adding/changing the
> > rotate line. You can find more information by running "man logrotate".
> > 
> ? We want daily log files, so setting 'rotate 4' will only give us 4 log
> files. Using weeks is no good because a month is not a fixed number of
> weeks - 30 and 31 days are not 4 weeks and vice-versa.
> 
> 
> John.

Hi John,

the short answer, which I haven't seen anybody yet give you, is,
logrotate can't do what you want to do. You're going to have to take
care of things yourself with some scripting.

Andy 

-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux