Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: mtime to remove old files
Hi,
Something like "find ... -mtime +1 ..." finds files that changed more than
one day ago. The number specifies a number of 24 hour periods, so if you
specify "+2" the file has to have been changed more than 48 hours ago. The
resolution of the time comparison only goes as low as a day.
So:
touch -m 09180000 wtupa.tmp
ls -l wtupa.tmp
-rw-rw-rw- 1 pete devel 3 Sep 18 00:00 wtupa.tmp
find . -name "wtupa.tmp" -mtime +2 (nothing found)
touch -m 09171705 wtupa.tmp
find . -name "wtupa.tmp" -mtime +2
result ---> ./wtupa.tmp
and the date is
Mon Sep 20 17:05:09 BST 2004
Regards
Pete
-----Original Message-----
From: Paula_Stankus_at_doh.state.fl.us
[mailto:Paula_Stankus_at_doh.state.fl.us]
Sent: 20 September 2004 12:02
To: Peter.Hitchman_at_thomson.com; oracle-l_at_freelists.org
Subject: mtime to remove old files
[leprod:> ls -la /dbdumps/backups/df*
-rw-r----- 1 oracle dba 5256142848 Sep 18 07:12
/dbdumps/backups/df_t51
When I use:
[leprod:> find /dbdumps/backups -name "df*" -mtime +0 -print
/dbdumps/backups/df_t537174441_s1_p1
[oracle_at_dohsdb10]:/usr/oracle/tools/bin
When I use anything other than +1 or more the file isn't found. However, the system date is Sep 20. Yet the last modified time was the 18th.
What am I missing?
-- http://www.freelists.org/webpage/oracle-lReceived on Mon Sep 20 2004 - 11:23:36 CDT
![]() |
![]() |