find on hpux

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf find on hpux

  • Creator
    Topic
  • #51810
    Bob Schmid
    Participant

      Why am I not getting 20100613.arc  when I do  “find . -mtime +1”

      – execute command on 6/15 at 1300

      drwxrwxr-x  47 hci        staff         2048 Mar  3 16:36 ..

      -rw-rw-r–   1 hci        staff      6673626 Jun  7 23:59 20100607.arc.gz

      -rw-rw-r–   1 hci        staff      6629398 Jun  8 23:59 20100608.arc.gz

      -rw-rw-r–   1 hci        staff      6199535 Jun  9 23:59 20100609.arc.gz

      -rw-rw-r–   1 hci        staff      5687903 Jun 10 23:59 20100610.arc.gz

      -rw-rw-r–   1 hci        staff      5194399 Jun 11 23:59 20100611.arc.gz

      -rw-rw-r–   1 hci        staff      13540297 Jun 12 23:59 20100612.arc

      -rw-rw-r–   1 hci        staff      12321744 Jun 13 23:58 20100613.arc

      -rw-rw-r–   1 hci        staff      39367989 Jun 14 23:59 20100614.arc

      drwxrwxr-x   2 hci        staff         2048 Jun 15 05:25 .

      -rw-rw-r–   1 hci        staff      20496435 Jun 15 13:00 20100615.arc

      did the following at 06/15 at 1300

      $ find . -mtime +1 -print

      ./20100607.arc.gz

      ./20100610.arc.gz

      ./20100611.arc.gz

      ./20100608.arc.gz

      ./20100612.arc

      ./20100609.arc.gz

    Viewing 2 reply threads
    • Author
      Replies
      • #71823
        James Cobane
        Participant

          Robert,

          I think that it may be because the returned value of n is not greater than 1.

        • #71824
          Levy Lazarre
          Participant

            Robert,

            I am also on HP-UX, so I was puzzled by your post.

            I performed the following experiment. I had the following two files in a directory:

            June 15   09:38     WHHMMG_20100915.txt

            June 15   23:34     WHHORU_20100915.txt

            Today (June 17) @ 10:00, I issued the following command and expected both files to be returned:

            find . -mtime +1 -print

            To my surprise, I found that only the first file was returned by the command, even though both files have the same date of June 15.

            I dug into my “Unix Power Tools” book and found out that my understanding of the ‘mtime’ option was not accurate. I learned that a number with the + sign refers to the period BEFORE that 24-hour period. Therefore, if we say -mtime +3, we are not looking for files that are 72 hours old or more, but rather 96 hours (72+24) old or more.

            Fractional 24-hour periods are truncated!  That means that

          • #71825
            Bob Schmid
            Participant

              That explains it!

          Viewing 2 reply threads
          • The forum ‘Cloverleaf’ is closed to new topics and replies.