On Wednesday 17 January 2007 14:29, John Nielsen wrote:
> On Wednesday 17 January 2007 13:52, Victor Snezhko wrote:
> > Tom Judge <[EMAIL PROTECTED]> writes:
> > > Hi,
> > >
> > > I have the following options in /etc/make.conf:
> > >
> > > NO_PROFILE=true
> > > NO_SENDMAIL=true
> > > NO_GAMES=true
> > > NO_I4B=true
> > > NO_ATM=true
> > > NO_INET6=true
> > > NO_BLUETOOTH=true
> > > NO_IPFILTER=true
> > > NO_RCMDS=true
> > > NO_KERBEROS=true
> > >
> > >
> > > However after a "make buildworld installworld" the utilities and libs
> > > associated with these packages are still installed,  is there any easy
> > > way to remove them from the system?
> >
> > make delete-old
>
> That will delete obsolete files no longer used by the current version of
> the operating system, but it won't do what the OP is asking.
>
> I don't know of a one-step way to do what you're asking. You could do a
> find over the base system directories and look for files older than your
> last installworld. That might not fit the "easy" part of the request since
> you'd have to go over the list manually to make sure it wasn't killing
> anything you actually need, but it should be mostly accurate.

Here's a script I just put together to get a good first approximation of 
outdated files using the approach above. Change the variables to be 
appropriate for your situation, review the output file carefully before 
deleting anything, and use at your own risk. :)

=== start prune.sh ===
#!/bin/sh

DIRS="/bin /lib /libexec /rescue /sbin /usr/bin /usr/games /usr/lib \
        /usr/libdata /usr/libexec /usr/sbin"
OUTFILE=/usr/local/scripts/prune-files.txt
AGE="1 month"

rm -f ${OUTFILE}
for d in ${DIRS} ; do
        find ${d} -type f ! -newermt "${AGE} ago" >> ${OUTFILE}.tmp
done

grep -vF "lib/compat" ${OUTFILE}.tmp | grep -vi perl > ${OUTFILE}
rm -f ${OUTFILE}.tmp

=== end prune.sh ===

JN
_______________________________________________
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to