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

Re: find



Am Mittwoch, 24. September 2014, 17:29:22 schrieb Gokan Atmaca:
> Within a directory backup "tar.gz" files you want to delete older than 1
> day.
> 
> I'm doing this as follows. But do not be.
> 
> find /backup/ +1 -delete -mtime
> 
> Can you help?

find /backup -mtime +0 -delete

find counts days as integers. More than 1 day in integer is everything from day 
2 onwards.

(yes thats crazy, but that is how find calculates it.

Use -ls instead of -delete for a test run.

Ciao,
-- 
Martin 'Helios' Steigerwald - http://www.Lichtvoll.de
GPG: 03B0 0D6C 0040 0710 4AFA  B82F 991B EAAC A599 84C7


Reply to: