in reply to Deleting files
Check out the find2perl command. I believe you would be looking for:
If you re-direct the results to a file you will end up with a skeleton of a perl script you can modify. Change the pertinate lines to make it do what you want. Further, you want to look at Perl's unlink command which does file removal.find2perl SOMEDIR -mtime +5 -print
Another way of doing it:
YMMV, HTH# hand waving prior to this # chdir $MYDIR; opendir(DIR,"$MYDIR") or die "Could not open $MYDIR:$!"; while (my $file=readdir(DIR)){ my $age= -M $file; unlink $file if int($age) > 5; } closedir(DIR);
| Peter L. Berghold -- Unix Professional Peter at Berghold dot Net | |
| Dog trainer, dog agility exhibitor, brewer of fine Belgian style ales. Happiness is a warm, tired, contented dog curled up at your side and a good Belgian ale in your chalice. | |
|
|---|