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
oracle@dev1:/u01/data/DB01/archive1 $ls -ltr
total 15116040
-rw-r----- 1 oracle dba 209714176 Nov 20 13:49 DB01_0001_0000000235.arc
-rw-r----- 1 oracle dba 209714176 Nov 20 14:10 DB01_0001_0000000236.arc
-rw-r----- 1 oracle dba 209714176 Nov 20 14:29 DB01_0001_0000000237.arc
-rw-r----- 1 oracle dba 209714176 Nov 20 14:47 DB01_0001_0000000238.arc
-rw-r----- 1 oracle dba 209714176 Nov 21 08:30 DB01_0001_0000000239.arc
-rw-r----- 1 oracle dba 209714176 Nov 23 21:34 DB01_0001_0000000240.arc
-rw-r----- 1 oracle dba 2048 Nov 24 07:48 DB01_0002_0000000001.arc
-rw-r----- 1 oracle dba 2048 Nov 24 08:41 DB01_0002_0000000002.arc
-rw-rw---- 1 oracle dba 209714176 Nov 26 05:23 DB01_0001_0000000041.arc
-rw-rw---- 1 oracle dba 209714176 Nov 26 05:55 DB01_0001_0000000042.arc
-rw-rw---- 1 oracle dba 209714176 Nov 26 05:56 DB01_0001_0000000043.arc
-rw-rw---- 1 oracle dba 160875520 Nov 30 11:10 DB01_0001_0000000056.arc
-rw-rw---- 1 oracle dba 6833152 Dec 1 18:36 DB01_0001_0000000001.arc
-rw-rw---- 1 oracle dba 880640 Dec 1 19:43 DB01_0001_0000000002.arc
-rw-rw---- 1 oracle dba 1668096 Dec 1 21:47 DB01_0001_0000000003.arc
-rw-rw---- 1 oracle dba 1844224 Dec 2 00:04 DB01_0001_0000000004.arc
-rw-rw---- 1 oracle dba 69372928 Dec 2 01:19 DB01_0001_0000000005.arc
-rw-rw---- 1 oracle dba 299008 Dec 2 01:41 DB01_0001_0000000006.arc
-rw-rw---- 1 oracle dba 85476352 Dec 2 19:05 DB01_0001_0000000026.arc
-rw-rw---- 1 oracle dba 209714176 Dec 3 08:56 DB01_0001_0000000027.arc
-rw-rw---- 1 oracle dba 209713152 Dec 3 09:03 DB01_0001_0000000028.arc
-rw-rw---- 1 oracle dba 209711104 Dec 3 09:09 DB01_0001_0000000029.arc
oracle@dev1:/u01/data/DB01/archive1 $find . -name "*.arc" -mtime +1 -exec ls -ltr {} \;
-rw-r----- 1 oracle dba 209714176 Nov 20 13:49 DB01_0001_0000000235.arc
-rw-r----- 1 oracle dba 209714176 Nov 20 14:10 DB01_0001_0000000236.arc
-rw-r----- 1 oracle dba 209714176 Nov 20 14:29 DB01_0001_0000000237.arc
-rw-r----- 1 oracle dba 209714176 Nov 20 14:47 DB01_0001_0000000238.arc
-rw-r----- 1 oracle dba 209714176 Nov 21 08:30 DB01_0001_0000000239.arc
-rw-r----- 1 oracle dba 209714176 Nov 23 21:34 DB01_0001_0000000240.arc
-rw-r----- 1 oracle dba 2048 Nov 24 07:48 DB01_0002_0000000001.arc
-rw-r----- 1 oracle dba 2048 Nov 24 08:41 DB01_0002_0000000002.arc
-rw-rw---- 1 oracle dba 209714176 Nov 26 05:23 DB01_0001_0000000041.arc
-rw-rw---- 1 oracle dba 209714176 Nov 26 05:55 DB01_0001_0000000042.arc
-rw-rw---- 1 oracle dba 209714176 Nov 26 05:56 DB01_0001_0000000043.arc
oracle@dev1:/u01/data/DB01/archive1 $find . -name "*.arc" -mtime +7 -exec ls -ltr {} \;
-rw-r----- 1 oracle dba 2048 Nov 24 07:48 ./DB01_0002_0000000001.arc
-rw-r----- 1 oracle dba 2048 Nov 24 08:41 ./DB01_0002_0000000002.arc
-rw-r----- 1 oracle dba 209714176 Nov 20 13:49 ./DB01_0001_0000000235.arc
-rw-r----- 1 oracle dba 209714176 Nov 20 14:10 ./DB01_0001_0000000236.arc
-rw-r----- 1 oracle dba 209714176 Nov 20 14:29 ./DB01_0001_0000000237.arc
-rw-r----- 1 oracle dba 209714176 Nov 20 14:47 ./DB01_0001_0000000238.arc
-rw-r----- 1 oracle dba 209714176 Nov 21 08:30 ./DB01_0001_0000000239.arc
-rw-r----- 1 oracle dba 209714176 Nov 23 21:34 ./DB01_0001_0000000240.arc
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
the actual mtime of the file
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