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

Re: del files that is 7 days or older

by djw (Vicar)
on Feb 14, 2001 at 20:06 UTC ( [id://58463]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to del files that is 7 days or older

I think you should check out File::stat to get all kinds of nice status information about files. You could setup a specific date you would like to have as your cut off date and then test it against the file creation date and delete if necessary. Here is a snippet:
$set_time = 2592000; # 30 days in epoch time modify for taste $current_date = time; $create_date = stat($_)->ctime; if ($create_date < ($current_date - $set_time)) { # deletion stuff here }


Hope this helps,
djw

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://58463]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.