Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: mtime to remove old files

RE: mtime to remove old files

From: Hitchman, Peter <Peter.Hitchman_at_thomson.com>
Date: Mon, 20 Sep 2004 17:23:42 +0100
Message-ID: <8D697B8FCEBB3744B3A1E4AE15E8331E4B877C@der-lon-msg-03.derwent.co.uk>


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?



This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email
--
http://www.freelists.org/webpage/oracle-l
Received on Mon Sep 20 2004 - 11:23:36 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US