find -mtime giving strage results in HP-UX

Hi,

I am using HP-UX B.11.23 U ia64

I am trying to retrieve files using -mtime option of find command

However I found that -mtime is not giving correct results

Following is the output of commands executed on 03-Dec-2009

It can be seen that -mtime +1 should have returned all files from "Dec 2" backwards
However it is listing files from "Nov 26" backwards

Similarly -mtime +1 should have returned all files from "Nov 26" backwards
instead the command is listing files "Nov 24" backwards

What could be the reason?

Does -mtime starts with last day of last month backwards in HP-UX?

Thanks and Regards,
Chetana

First off - mtime +1 finds files that are > 86400 seconds (1 days worth of seconds) older than RIGHT NOW, not 1 "day" older as us humans view the calendar.

So the results you get will depend upon

  1. the actual mtime of the file
  2. what time of day you run find relative to the filetime.

That said I don't see why you do not get files from Dec 1 and Nov 30. And no, to the best of my knowledge find on 11.23 is not broken, nor is it in need of a patch.

Are these files mounted on a remote machine - in another time zone or on a box with a time drift problem?? mtime uses epoch seconds as mtime stored in the directory file -- not what you see in the ls -l display.

Many Thanks Jim!

Those files were on SAN!!

Now tested on local drive, but still results are strange as can be seen below :

I am sure if there were files modified on "Nov 30" in this directory, those would have listed in "find . -mtime +1"

Thanks and Regards,
Chetana