[nylug-talk] logrotate question

Rodrick Brown rodrick.brown at gmail.com
Sat Feb 2 19:41:34 EST 2008


On 2/2/08, C Thala <cthala at gmail.com> wrote:
>
> On Feb 2, 2008 5:00 PM, Kristian Erik Hermansen wrote:
> > > I would like to keep the last N files. Let's say 5.
> >
> > Delete all files created more than 5 days ago?
> > $ find /path/to/logs -ctime +5 -type f -exec rm -f {} \;


This is actually a much better approach than trying to just keep the last N
files.

I know how to use find/xargs to delete files by timestamp.
>
> What I want to do is to delete anything over the last N files.
>
> _____________________________________________________________________________
> Hire expert Linux talent by posting jobs here :: http://jobs.nylug.org
> The nylug-talk mailing list is at nylug-talk at nylug.org
> The list archive is at http://nylug.org/pipermail/nylug-talk
> To subscribe or unsubscribe: http://nylug.org/mailman/listinfo/nylug-talk
>



-- 
Rodrick R. Brown
http://www.rodrickbrown.com


More information about the nylug-talk mailing list