my $days = 2; my $keep_as_of = time - ( $days * 84600 ); my @old_files = ( grep{ !-d && ! /\.zip$/i && ( stat( $_ ) )[9] < $keep_as_of } glob( "/path/to/directory/*" ) ); unlink @old_files; print "The following files have been removed\n\n", join "\n", @old_fil +es;
In reply to Re: Deleting files older then 48 hours..
by Jazz
in thread Deleting files older then 48 hours..
by Kage
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |