Operating System - Linux
1752687 Members
5299 Online
108789 Solutions
New Discussion юеВ

Re: Linux script for purging old files

 
SOLVED
Go to solution
Matti_Kurkela
Honored Contributor

Re: Linux script for purging old files

The -ctime, -mtime and -atime options of the find command calculate the file's age by 24-hour periods, ignoring any fractional part.

"-mtime 7" finds files which are _exactly_ 7 days old, i.e. files with ages between [exactly 7 days] and [7 days, 23 hours, 59 minutes and 59 seconds].

"-mtime +7" finds files which are more than 7 full 24-hour periods old, i.e. 8 days old or older. A file that is 7 days, 23 hours, 59 minutes and 59 seconds old is counted as 7 days old, and "more than 7" means 8 days or more.

MK
MK
Jorge Cocomess
Super Advisor

Re: Linux script for purging old files

Much better explainations...Thank you!
Jorge Cocomess
Super Advisor

Re: Linux script for purging old files

Thanks!