LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Find acting wierd (https://www.linuxquestions.org/questions/linux-software-2/find-acting-wierd-267496/)

RaelOM 12-17-2004 03:29 PM

Find acting wierd
 
-mtime is based on 24 hours.

Running your commant with -mtime +0 will not return any of the files in the /u02/backup directory as none of those files are more than 24 hours old. Granted today is the 17th and yesterday was the 16th, the oldest file in that dir is: 16:50, right now it's only 15:24 --not quite 24 hours old.

Running -time +1 will return all files older than 48 hours. Now in the find manual it says X*24 soo you'd think -mtime +2 would be 48, but for some odd reason it's treating it like 72 hours.

The exact command I'd like to use is:

Code:

find . * -mtime +2 -exec rm {} \;
However, until I fix this I'm using:

Code:

find . * -mtime +2 -exec ls -la {} \;
I'm looking to find all files within a directory that are older than 72 hours and remove them.

Simple right? Well, I don't mind slapping find into working using +2 to reutnr 72, but I can't get it outta my head that 2*24 == 48 but it's not.

What gives?

JunctaJuvant 12-17-2004 03:42 PM

Perhaps the "+" means values are added to the default value of 24, thus with +1 you get 24 + (1*24) = 48 and with +2 you get 24 + (2*24) = 72
But maybe someone else has a more plausible explanantion?

JJ


All times are GMT -5. The time now is 04:15 AM.