An example:

I need to write some scripts which can automatically, but reliably,
prune files older than X days old from our postgresql WAL log dir.
Thus far, I've been doing this by hand as I cannot get find to print
out the results I expect.

Since last clean-up, the directory contains the following files:

Total number of files: 1442 (and growing)

Oldest file:
-rw-------  1 postgres postgres 3969164 Apr  8 13:50 00000001000001BF000000DB.gz

Newest file:
-rw-------  1 postgres postgres 3622808 Apr  9 10:22 00000001000001C500000081.gz

[EMAIL PROTECTED] recovery]$ find . -mtime 1 -ls && find .
-atime 1 -ls && find . -ctime 1 -ls
No results returned. I would expect that this would return files from
1*24 hours ago. Even if it's looking for files that were created at
1034am yesterday (24 hours ago at the time of my writing this mail), I
would expect something from Apr. 8th to be shown.

[EMAIL PROTECTED] recovery]$ find . -mtime -0 -ls && find .
-atime 0 -ls  && find . -ctime 0 -ls
Returned list of files contains within it files created as recently as
60 seconds ago.

As I said, I'm probably not using the correct combination of time and
modifiers... but it'd make life much easier if there was a friendlier
way of finding files in such manner in find rather than having to use
ls -lt, or perl/ruby libs.

Regards,

-salman



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to