RE: mtime to remove old files
- From: "Hitchman, Peter" <Peter.Hitchman@xxxxxxxxxxx>
- To: oracle-l@xxxxxxxxxxxxx
- Date: Mon, 20 Sep 2004 17:23:42 +0100
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@xxxxxxxxxxxxxxx
[mailto:Paula_Stankus@xxxxxxxxxxxxxxx]
Sent: 20 September 2004 12:02
To: Peter.Hitchman@xxxxxxxxxxx; oracle-l@xxxxxxxxxxxxx
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@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
Other related posts: