Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Aging Script

by suaveant (Parson)
on Aug 08, 2001 at 22:27 UTC ( [id://103152] : note . print w/replies, xml ) Need Help??


in reply to Aging Script

try this...
$cutoff = time() - 31*24*60*60; while(</dir/to/read/*>) { unlink $_ if (stat $_)[10] < $cutoff; }
that should work... maybe replace unlink with print to test it first ;)

                - Ant
                - Some of my best work - Fish Dinner

Replies are listed 'Best First'.
Re: Re: Aging Script
by Seema (Novice) on Aug 09, 2001 at 01:16 UTC
    Suaveant..
    Thanx, that helped out. The script runs fine!
    ~Seema