in reply to Deleting files based on date
Here's one way,
That uses the file test operators to check if each name rperesents an ordinary file, and to see if the file is more than 30 days old. Adjust $days (can be fractional) for age, and the argument of glob for path and any specializations like file extension.my $days = 30; for (glob '*') { unlink if -f and -M > $days; }
After Compline,
Zaxo
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Deleting files based on date
by DrHyde (Prior) on Oct 20, 2003 at 07:53 UTC | |
by liz (Monsignor) on Oct 20, 2003 at 08:55 UTC |