in reply to Deleting files over 2 weeks old?
Of course, this will just print which files it would delete, not actually delete them. That's left to the reader. :)#!/usr/bin/perl -w use strict; use File::Find; my($dir) = shift; my($days) = 14; die "Invalid dir" unless (-d $dir); &find(\&wanted, "$dir"); sub wanted { -f && (int(-C _) < $days) && print "$File::Find::name\n"; }
|
|---|