Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Discussion & Documentation Documentation, Tips & Tricks
  • Search

Filesystem cruft script: clean your system, save disk space!

Unofficial documentation for various parts of Gentoo Linux. Note: This is not a support forum.
Post Reply
Advanced search
243 posts
  • Page 2 of 10
    • Jump to page:
  • Previous
  • 1
  • 2
  • 3
  • 4
  • 5
  • …
  • 10
  • Next
Author
Message
ecatmur
Advocate
Advocate
User avatar
Posts: 3595
Joined: Mon Oct 20, 2003 8:07 pm
Location: Edinburgh
Contact:
Contact ecatmur
Website

  • Quote

Post by ecatmur » Tue Apr 13, 2004 11:43 pm

Well, I don't use webmin or usermin so I can't help much with those, although if you post a stanza to list relevant files I will be happy to add it in.

On the upside, I've just added X.org and ruby support.
Top
manywele
l33t
l33t
User avatar
Posts: 743
Joined: Sat Jul 12, 2003 12:48 am
Location: Inside

  • Quote

Post by manywele » Wed Apr 14, 2004 12:03 am

To list some of the stuff it's finding:

Code: Select all

/var/www/localhost/htdocs/squirrelmail/data
/var/www/localhost/htdocs/<stuff I added>
/var/spool/postfix
/var/log/*
/usr/share/xplanet/<lots of stuff>
/etc/postfix
/etc/pam.d
/etc/ddclient
/etc/apache2/<keys>
/usr/libexec/webmin
/var/webmin
~/.maildir (my mail isn't cruft!)
16041 files. Some of it is cruft (mostly stuff in /usr/share/doc and /usr/share/man) but most of it isn't.
Top
ecatmur
Advocate
Advocate
User avatar
Posts: 3595
Joined: Mon Oct 20, 2003 8:07 pm
Location: Edinburgh
Contact:
Contact ecatmur
Website

  • Quote

Post by ecatmur » Wed Apr 14, 2004 1:25 am

Added /var/www.
/var/log is managed per-package.
/usr/share/xplanet is handled fine on my machine - have you added some files?
/var/spool/postfix, /etc/postfix are in the ebuild, -r2 at least.
Plenty of ebuilds install into /etc/pam.d.
For /etc/ddclient I need to know what the conf files are called.
Is there a way to know what the /etc/apache2/<keys> files are?
/var/webmin is excluded already - are you sure webmin is installed via Portage?
/home is excluded, so no idea why ~/.maildir would be listed.
No more cruft
dep: Revdeps that work
Using command-line ACCEPT_KEYWORDS?
Top
manywele
l33t
l33t
User avatar
Posts: 743
Joined: Sat Jul 12, 2003 12:48 am
Location: Inside

  • Quote

Post by manywele » Wed Apr 14, 2004 2:05 am

ecatmur wrote:Added /var/www.
/var/log is managed per-package.
/usr/share/xplanet is handled fine on my machine - have you added some files?
/var/spool/postfix, /etc/postfix are in the ebuild, -r2 at least.
Plenty of ebuilds install into /etc/pam.d.
For /etc/ddclient I need to know what the conf files are called.
Is there a way to know what the /etc/apache2/<keys> files are?
/var/webmin is excluded already - are you sure webmin is installed via Portage?
/home is excluded, so no idea why ~/.maildir would be listed.

Code: Select all

/etc/ddclient/{ddclient.cache,ddclient.conf}

/etc/apache2/conf<domain>.key
/etc/apache2/conf/<domain>.key.unsecure
/etc/apache2/conf/<domain>.key.unsecure.csr
/etc/apache2/conf/ssl
/etc/apache2/conf/ssl/server.crt
/etc/apache2/conf/ssl/server.crt.orig
/etc/apache2/conf/ssl/server.key
/etc/apache2/conf/ssl/server.key.orig
Whoops, I had uninstalled webmin/usermin as I wasn't using them so it was actuall cruft. Thanks again! The ~/.maildir is actually /.maildir left over from long ago I believe. Sorry. Need to find out what that's doing there.

Yeah, I guess all the xplanet stuff is addons from the xplanet site (hurricanes, forecast, images, etc.).

I've got postfix-2.0.19 and it's listing 148 postfix files including /etc/postfix/sample/*.

It seems to be listing everything in /var/log including apache, ftpd, telnet, sshd, pwdfail, kernel, everything, critical.

Down to 2289 files now, most of them stuff I've installed myself or stuff I need to look through. Love this script!
Top
gnac
Guru
Guru
User avatar
Posts: 302
Joined: Mon Jun 30, 2003 5:01 pm
Location: Columbia River Gorge

  • Quote

Post by gnac » Sat Apr 17, 2004 10:09 pm

having a little problem with your script, which btw I appreciate.

When I try to run it (as root) I get the following error:

Code: Select all

./cruft: line 513: syntax error near unexpected token `&&'
./cruft: line 513: `    && [ -r /usr/share/baselayout/mkdirs.sh ]'
Any thoughts?

Thanks
"I thought she'd steal my heart, instead she stole my kidney,
and now its for sale, on the black market in Sydney" - Better Abraham
Top
ecatmur
Advocate
Advocate
User avatar
Posts: 3595
Joined: Mon Oct 20, 2003 8:07 pm
Location: Edinburgh
Contact:
Contact ecatmur
Website

  • Quote

Post by ecatmur » Sat Apr 17, 2004 10:35 pm

Fixed now, thanks.
No more cruft
dep: Revdeps that work
Using command-line ACCEPT_KEYWORDS?
Top
GaMMa
l33t
l33t
User avatar
Posts: 684
Joined: Fri Aug 23, 2002 7:17 pm
Location: USA

  • Quote

Post by GaMMa » Tue Apr 20, 2004 10:36 pm

Awsome script, I was wondering how to get rid of all my old files for a while now. Things I thought were associated with packages turned out to be cruft. Good job, keep up the good work.
Ubuntu Linux Dapper Drake running Gnome-2.14.1
[Website | Screenshot | Portage Guide]
Top
brianhearn
n00b
n00b
User avatar
Posts: 72
Joined: Tue Nov 04, 2003 12:57 pm

  • Quote

Post by brianhearn » Wed Apr 21, 2004 8:54 pm

Pretty cool.

It would be nice if it ignored my windows partition which is always mounted... it's listing 30+ GB of cruft under /c. I realise that's a matter of opinion, but the first 37000 lines are from this drive!
Top
ecatmur
Advocate
Advocate
User avatar
Posts: 3595
Joined: Mon Oct 20, 2003 8:07 pm
Location: Edinburgh
Contact:
Contact ecatmur
Website

  • Quote

Post by ecatmur » Wed Apr 21, 2004 11:03 pm

cruft ignores a number of toplevel directories. e.g. /opt, /mnt and /media. I mount my windows drive as /opt/windows.
No more cruft
dep: Revdeps that work
Using command-line ACCEPT_KEYWORDS?
Top
GaMMa
l33t
l33t
User avatar
Posts: 684
Joined: Fri Aug 23, 2002 7:17 pm
Location: USA

  • Quote

Post by GaMMa » Thu Apr 22, 2004 12:05 am

Add a line to the script and tell it to ignore that directory. I added a ton of stuff because there are some things I didn't install through portage.
Ubuntu Linux Dapper Drake running Gnome-2.14.1
[Website | Screenshot | Portage Guide]
Top
GeoffOs
n00b
n00b
Posts: 56
Joined: Sat Dec 13, 2003 11:59 pm
Location: Cheshire
Contact:
Contact GeoffOs
Website

Squid

  • Quote

Post by GeoffOs » Sat Apr 24, 2004 8:11 am

For some reason it seems to be picking up my squid cache?
Edit:
It also picks up /var/lib/setiathome
I have set it to ignore but, could we not pass in an ignore list, that way we can pick up any updates, without loosing our ignore list
Beyond a critical point within a finite space, freedom diminishes as numbers increase. ...
The human question is not how many can possibly survive within the system, but what kind of existence is possible for those who do survive."
Top
ecatmur
Advocate
Advocate
User avatar
Posts: 3595
Joined: Mon Oct 20, 2003 8:07 pm
Location: Edinburgh
Contact:
Contact ecatmur
Website

  • Quote

Post by ecatmur » Sat Apr 24, 2004 8:52 am

Added, and added. I'm not going to add support for passing in an ignore list because I want everyone to benefit from new exceptions being added.

"For some reason"... it picks up anything that isn't installed at emerge time (and a few things that are, if the ebuild is kludgy) except stuff in directories that don't belong to a Linux system and auto-cleaned temp directories. /var/cache/squid is in /var/cache, so it would get picked up (but not now, of course).
No more cruft
dep: Revdeps that work
Using command-line ACCEPT_KEYWORDS?
Top
BudgetDedicated
n00b
n00b
Posts: 12
Joined: Mon Apr 26, 2004 10:15 pm
Location: NL
Contact:
Contact BudgetDedicated
Website

  • Quote

Post by BudgetDedicated » Mon Apr 26, 2004 10:43 pm

Maybe add a notice that it's meant to just generate a link. Normally a user might want to evade any of these scripts... Shouldn't it be promoted as a 'remove candidate list' generator?

Note that to few false positives can result in (barely) careless people removing just 'a few essential files' and still corrupt their system?

Could you add:
/vmlinu.*
/\.*config\*
/System.map
/
Might be pretty important... :wink:

And maybe consider:
/usr/sbin/gcc-config
*/lost+found/
Grt, Erik
[ My commercial Ad.: Europe's top quality Gentoo VPS provider: BudgetDedicated (starting at 20 euro/month) ]
Top
ecatmur
Advocate
Advocate
User avatar
Posts: 3595
Joined: Mon Oct 20, 2003 8:07 pm
Location: Edinburgh
Contact:
Contact ecatmur
Website

  • Quote

Post by ecatmur » Tue Apr 27, 2004 12:31 am

BudgetDedicated wrote:Maybe add a notice that it's meant to just generate a link. Normally a user might want to evade any of these scripts... Shouldn't it be promoted as a 'remove candidate list' generator?

Note that to few false positives can result in (barely) careless people removing just 'a few essential files' and still corrupt their system?
It's version 0.0.4 (version bump!) Anyone who trusts something this primitive doesn't deserve to be an admin...
Could you add:
/vmlinu.*
/\.*config\*
/System.map
These should be in /boot.
/
Might be pretty important... :wink:
Odd... that should handled already. Can you try again with the latest version?
And maybe consider:
/usr/sbin/gcc-config
*/lost+found/
gcc-config is in /usr/bin... which version of gcc-config do you have?
lost+found: OK, it now ignores lost+found for each mountpoint, but still flags files therein. Is this OK?
No more cruft
dep: Revdeps that work
Using command-line ACCEPT_KEYWORDS?
Top
ecatmur
Advocate
Advocate
User avatar
Posts: 3595
Joined: Mon Oct 20, 2003 8:07 pm
Location: Edinburgh
Contact:
Contact ecatmur
Website

  • Quote

Post by ecatmur » Thu Apr 29, 2004 12:58 pm

Update: now handles kernel modules (checks for installed linux-sources ebuilds and notes the corresponding directory in /lib/modules) - so now you don't need to worry about remembering to clear out /lib/modules when you update your kernel.
No more cruft
dep: Revdeps that work
Using command-line ACCEPT_KEYWORDS?
Top
ecatmur
Advocate
Advocate
User avatar
Posts: 3595
Joined: Mon Oct 20, 2003 8:07 pm
Location: Edinburgh
Contact:
Contact ecatmur
Website

  • Quote

Post by ecatmur » Sat May 01, 2004 4:30 pm

Version 0.0.5.
New packages: xcdroast, acovea, GIMPS, shorewall, acpid.
Now handles /etc/init.d scripts (anything in a runlevel is OK, so now net.* scripts are handled as long as they are in a runlevel).
No more cruft
dep: Revdeps that work
Using command-line ACCEPT_KEYWORDS?
Top
tom56
Guru
Guru
User avatar
Posts: 325
Joined: Tue Apr 27, 2004 8:39 pm
Location: united kingdom

  • Quote

Post by tom56 » Sat May 01, 2004 5:04 pm

i read somewhere, though i can't remember where, that this feature is being implemented in emerge soon.
Top
GaMMa
l33t
l33t
User avatar
Posts: 684
Joined: Fri Aug 23, 2002 7:17 pm
Location: USA

  • Quote

Post by GaMMa » Sat May 01, 2004 9:39 pm

I just wanted to say; good work! Keep it up.
Ubuntu Linux Dapper Drake running Gnome-2.14.1
[Website | Screenshot | Portage Guide]
Top
ecatmur
Advocate
Advocate
User avatar
Posts: 3595
Joined: Mon Oct 20, 2003 8:07 pm
Location: Edinburgh
Contact:
Contact ecatmur
Website

  • Quote

Post by ecatmur » Mon May 03, 2004 7:03 am

tom56 wrote:i read somewhere, though i can't remember where, that this feature is being implemented in emerge soon.
Interesting... it'd be nice to get some developer love on this.

Anyway, 0.0.6 now. A few things: some stderr status output; more fine-grained over portage, devfs and udev; and faster package version checking code (written in bash by me, much faster than launching Python each time).
No more cruft
dep: Revdeps that work
Using command-line ACCEPT_KEYWORDS?
Top
revertex
l33t
l33t
User avatar
Posts: 806
Joined: Wed Apr 23, 2003 9:21 am

  • Quote

Post by revertex » Tue May 04, 2004 7:57 am

nice script, thank's.
but i guess it's a false positive

Code: Select all

/usr/share/wallpapers/
/usr/share/wine/
/usr/share/xine/skins/
/usr/share/xmms/Skins/
/var/lib/nessus/
/var/lib/ntop/
Top
ecatmur
Advocate
Advocate
User avatar
Posts: 3595
Joined: Mon Oct 20, 2003 8:07 pm
Location: Edinburgh
Contact:
Contact ecatmur
Website

  • Quote

Post by ecatmur » Tue May 04, 2004 12:22 pm

What does /usr/share/wallpapers belong to? If it's yours then it should be in /usr/local.

Is /usr/share/wine your fake windows drive? You'd be better off moving it to /opt/winedrive, or at least /usr/local/share/wine.

Xine: nope, not adding that. Put skins in ~/.xine.

For xmms:
# Add /usr/local/share/xmms/Skins to the search path for skins
epatch ${PATCHDIR}/${P}-fhs-skinsdir.patch
OK, added nessus and ntop.
No more cruft
dep: Revdeps that work
Using command-line ACCEPT_KEYWORDS?
Top
ecatmur
Advocate
Advocate
User avatar
Posts: 3595
Joined: Mon Oct 20, 2003 8:07 pm
Location: Edinburgh
Contact:
Contact ecatmur
Website

  • Quote

Post by ecatmur » Tue May 04, 2004 12:24 pm

Actually, better would be a xine-themes ebuild. I just posted one, see http://bugs.gentoo.org/show_bug.cgi?id=49959 - hopefully it will be added to Portage soon.

Hmmm... wonder who'll get the 50000th Gentoo bug? Quite a milestone... :D
No more cruft
dep: Revdeps that work
Using command-line ACCEPT_KEYWORDS?
Top
revertex
l33t
l33t
User avatar
Posts: 806
Joined: Wed Apr 23, 2003 9:21 am

  • Quote

Post by revertex » Tue May 04, 2004 6:00 pm

huh, i just put some wallpapers there to de system wide, wrong place at all :oops:
I need to do a better use of /usr/local (sorry, i'm a n00b, still learning)
Top
trevorj
n00b
n00b
Posts: 68
Joined: Tue May 13, 2003 4:12 pm
Contact:
Contact trevorj
Website

ccache

  • Quote

Post by trevorj » Wed May 05, 2004 7:04 am

If you use ccache, EVERY file in /var/tmp/ccache shows up ( 3000+ ), and I wouldn't consider that cruft =)
\\ trevorj
Top
ecatmur
Advocate
Advocate
User avatar
Posts: 3595
Joined: Mon Oct 20, 2003 8:07 pm
Location: Edinburgh
Contact:
Contact ecatmur
Website

  • Quote

Post by ecatmur » Wed May 05, 2004 10:26 am

Oh yeah, good catch. Thanks - fixed now.
No more cruft
dep: Revdeps that work
Using command-line ACCEPT_KEYWORDS?
Top
Post Reply

243 posts
  • Page 2 of 10
    • Jump to page:
  • Previous
  • 1
  • 2
  • 3
  • 4
  • 5
  • …
  • 10
  • Next

Return to “Documentation, Tips & Tricks”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic