in reply to Hard disc pruner
Here's a simple codeup of my recomendation.... You should test it THOUROUGHLY before uncommenting the unlink line..
#!/usr/bin/perl -w use strict; use File::Find; my %keep; # load %keep with the filenames you want to keep... # $keep{/bin/sh}=1; # $keep{/sbin/ifconfig}=1; # etc.... find(\&checkfile,'/'); sub checkfile{ my $fname="$File::Find::dir/$_"; if(!defined $keep{$fname}){ print "deleting $fname\n"; # unlink $fname; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: Re: Hard disc pruner
by mikfire (Deacon) on Jul 08, 2000 at 03:47 UTC |