Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Deleting files older then 48 hours..

by Jazz (Curate)
on Nov 13, 2001 at 01:20 UTC ( [id://124917]=note: print w/replies, xml ) Need Help??


in reply to Deleting files older then 48 hours..

my $days = 2; my $keep_as_of = time - ( $days * 84600 ); my @old_files = ( grep{ !-d && ! /\.zip$/i && ( stat( $_ ) )[9] < $keep_as_of } glob( "/path/to/directory/*" ) ); unlink @old_files; print "The following files have been removed\n\n", join "\n", @old_fil +es;

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://124917]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (5)
As of 2024-04-24 03:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found