SUMMARY: find with less than a day granularity

From: James Cayz (
Date: Tue Feb 25 1997 - 09:26:18 CST

Original Question:

> I am using find with an atime 0 parameter to delete files
>from /tmp, but that means I have at least a day's worth of file laying
>around. I would like to reduce this time period to something smaller,
>say 4 or 6 hours. Is it already an obscure option to a std command,
>or does someone out there have a suitable replacement for find? I
>need to run this from cron (every 4 - 6 hours).

Thanks to the responses below, I am going to use a "timestamp" file,
which I can set the time of by using touch, and use the -newer
function of find. Little kudgy, but then again, so is a lot of Unix
:-) :-). Rather do it with a touch -t than a file that sits in /tmp
from the last find, just in case the timestamp file gets mangled in
the interim...

On Mon, 17 Feb 1997, Colin J. Wynne wrote:
>If it will be run from cron anyway, why not write a script which
>touches a timestamp file and then compares times of files under /tmp
>to that timestamp file? That way, each time it runs, files older than
>the last time the script ran will be axed.

On Fri, 21 Feb 1997, Jochen Bern wrote:
>How about running the following Command from cron every 4-6h?
>find /tmp -newer /time/stamp -o -print | xargs rm -f ; touch /time/stamp
>(add other find Options as needed)

        Thanks Again,
        James Cayz

[ James Cayz: # Voice 302-739-4748 x130 / Fax 302-739-6948 ]
[ Delaware Division of Libraries # 43 S. DuPont Hwy / Dover, DE 19901-7430 ]

This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:11:47 CDT