Amusing note. I wrote this after accidentally crashing someone else's ftp server by throwing the accumulated contents of a large dir at it. The next day I went and made every change I could think of that would have prevented the disaster. Running this script daily was one of those changes. :-)#! /usr/local/bin/perl die unless chdir "/some/hardcoded/dir/here"; die unless opendir DIR, "."; foreach $file (grep {-f && (14 < -M)} readdir DIR) { unlink $file; } closedir DIR;
EDIT
Hmmm...this was one of my earlier scripts. Definitely
before I learned the value of informative error messages.
And written in a hurry...but I think I should leave it
anyways as an example to show that my coding style has
matured...
In reply to RE (tilly) 1: Find files older than x days and delete them
by tilly
in thread Find files older than x days and delete them
by OzzyOsbourne
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |