go ahead... be a heretic | |
PerlMonks |
Re: Deleting old files from directoryby chrestomanci (Priest) |
on Sep 27, 2011 at 20:03 UTC ( [id://928166]=note: print w/replies, xml ) | Need Help?? |
If you are using unix/linux, then an alternative way to find and delete old files is with find and xargs: find <directory> -type f -ctime +10 -name "*some*pattern*.txt" | xargs rm -fI have fragments like that in the crontab for the systems I maintain, as it is very easy to setup and then just leave to run for ever.
In Section
Seekers of Perl Wisdom
|
|