Filesystem cruft script: clean your system, save disk space!
|
View unanswered posts
View posts from last 24 hours
Goto page Previous 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 Next
|
View previous topic :: View next topic |
Author |
Message |
ecatmur Advocate
Joined: 20 Oct 2003 Posts: 3595 Location: Edinburgh
|
Posted: Thu May 20, 2004 6:52 am Post subject: |
|
|
gnac wrote: | I just downloaded the latest version of this script, but I'm not sure if I fully understand its operation.
When I run it I get the portagefiles(15M) and allfiles(8M) in /tmp. But reading the files I find numerous files that I would assume are needed system files, and if not, many that I'm sure I do not want to delete:
I was under the assumption that files listed in these two files were okay to delete, but looking at the output I assume that this assumption is incorrect.
Any thoughts? | Ah, no, it's the actual output to the console that is the listing of files cruft suggests for you to delete. The files in /tmp are just temporary lists of the files owned by portage and guessed by cruft, and the files on your system in Portage-controlled areas respectively. _________________ No more cruft
dep: Revdeps that work
Using command-line ACCEPT_KEYWORDS? |
|
Back to top |
|
|
djm Arch/Herd Tester
Joined: 12 Apr 2004 Posts: 690 Location: Wadham College, Oxford
|
Posted: Thu May 20, 2004 11:36 am Post subject: |
|
|
Quote: | No way though am I going to give my script the ability to actually delete things. Not until version 0.4 at least anyway. |
Not even with rm -i?
Personally I prefer to just put the output into a file, check the file and then use that, but rm -ir `cruft` (or the equivalent built into the script) should be ok (actually, letting people choose whether to have the output displayed on the screen, in a file, or "rm -ir"ing would but a nice thing to put in) _________________ the forums.gentoo.org poster formally known as metal leper |
|
Back to top |
|
|
gnac Guru
Joined: 30 Jun 2003 Posts: 302 Location: Columbia River Gorge
|
Posted: Thu May 20, 2004 12:45 pm Post subject: |
|
|
ecatmur wrote: | Ah, no, it's the actual output to the console that is the listing of files cruft suggests for you to delete.... |
Oh, good thing I didn't do something like "cat /tmp/portagefiles | xargs rm". _________________ "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 |
|
Back to top |
|
|
RaveRod n00b
Joined: 20 May 2004 Posts: 17 Location: Brisbane, Australia
|
Posted: Thu May 20, 2004 3:13 pm Post subject: |
|
|
Hey, great script. Works great.
I've added the directories and files I don't want to be displayed but one directory, I think, should be added to the default list:
/var/run
All the .pid files in that directory are being shown as files to delete. |
|
Back to top |
|
|
ecatmur Advocate
Joined: 20 Oct 2003 Posts: 3595 Location: Edinburgh
|
Posted: Thu May 20, 2004 6:09 pm Post subject: |
|
|
metal leper wrote: | Quote: | No way though am I going to give my script the ability to actually delete things. Not until version 0.4 at least anyway. |
Not even with rm -i?
Personally I prefer to just put the output into a file, check the file and then use that, but rm -ir `cruft` (or the equivalent built into the script) should be ok (actually, letting people choose whether to have the output displayed on the screen, in a file, or "rm -ir"ing would but a nice thing to put in) |
But then it would be my fault. I've seen other people get bitten by this kind of thing.
However, the output is now tee'd to /tmp/cruft-cruftfiles. That might help. _________________ No more cruft
dep: Revdeps that work
Using command-line ACCEPT_KEYWORDS? |
|
Back to top |
|
|
ecatmur Advocate
Joined: 20 Oct 2003 Posts: 3595 Location: Edinburgh
|
Posted: Thu May 20, 2004 6:11 pm Post subject: |
|
|
RaveRod wrote: | Hey, great script. Works great.
I've added the directories and files I don't want to be displayed but one directory, I think, should be added to the default list:
/var/run
All the .pid files in that directory are being shown as files to delete. | Not all of them.
Code: | # Explicitly referenced pidfiles
sed ':a;/\\$/N;s/\\\n//;ta;s/^.*start-stop-daemon.*\(\<-p\|--pidfile\>\|\<-m\|--make-pidfile\>\)\s*\(\/\S\+\).*$/\2/;tb;s/^.*pidfile=\(\/\S\+\).*$/\1/;tb;d;:b;s/\s\+/\n/g' /var/lib/init.d/started/*
# Guess some pidfiles
for service in /var/lib/init.d/started/*; do
echo /var/run/${service##*/}.pid
done
for service in /var/lib/init.d/started/net.ppp*; do
echo /var/run/${service##*/net.}.pid
done
|
Any extra that belong to running services, please tell me about. Thanks. _________________ No more cruft
dep: Revdeps that work
Using command-line ACCEPT_KEYWORDS? |
|
Back to top |
|
|
Keffin Apprentice
Joined: 14 Feb 2004 Posts: 202 Location: England
|
Posted: Fri May 21, 2004 3:18 pm Post subject: |
|
|
The script gave me 4400 files to delete (), the only ones that might be false are the following from aMSN:
Code: | /usr/lib/amsn/plugins/traydock/Makefile
/usr/lib/amsn/plugins/traydock/Makefile.in
/usr/lib/amsn/plugins/traydock/README
/usr/lib/amsn/plugins/traydock/config.h
/usr/lib/amsn/plugins/traydock/config.h.in
/usr/lib/amsn/plugins/traydock/config.log
/usr/lib/amsn/plugins/traydock/config.status
/usr/lib/amsn/plugins/traydock/configure
/usr/lib/amsn/plugins/traydock/tray.c
/usr/lib/amsn/plugins/traydock/tray.o
/usr/lib/amsn/plugins/traydock/traydock |
I have aMSN installed but just removed Gnome and switched to a -gnome USE flag. These traydock files could be Gnome related but I didn't want to delete them just in case.
Thanks a lot. _________________ Always cut the deck if it ups your odds. |
|
Back to top |
|
|
ecatmur Advocate
Joined: 20 Oct 2003 Posts: 3595 Location: Edinburgh
|
|
Back to top |
|
|
Keffin Apprentice
Joined: 14 Feb 2004 Posts: 202 Location: England
|
Posted: Fri May 21, 2004 6:03 pm Post subject: |
|
|
FYI I just tested and you are perfectly right . _________________ Always cut the deck if it ups your odds. |
|
Back to top |
|
|
kamagurka Veteran
Joined: 25 Jan 2004 Posts: 1026 Location: /germany/munich
|
Posted: Sat May 22, 2004 6:58 pm Post subject: |
|
|
very nice, thanks.
there are a couple things listed that shouldnt be, though:
1. it lists the whole contents of /usr/share/xmms/Skins (i have xmms installed, though)
2. apparenty it doesnt like the icons i put in /usr/share/pixmaps. maybe this is due to a fault of mine, tho. is there a better place to put those?
3. is it supposed to list this?
Code: | /etc/gentoo
/etc/gentoo/gentoogtkrc
/etc/gentoo/gentoorc
|
4. it lists /usr/bin/TeamSpeak although i have ts installed. i dont exactly remember if that binary was installed normally, i might have had to put it there manually or something.
5. /usr/bin/kill <- i really think i need this...
6. it lists a whole load of perl5 and python2.2 stuff. i dont really feel comfortable deleting that. how do i find out what version of perl and python im using? _________________ If you loved me, you'd all kill yourselves today.
--Spider Jerusalem, the Word |
|
Back to top |
|
|
tofagerl n00b
Joined: 30 Mar 2004 Posts: 14
|
Posted: Sun May 23, 2004 10:13 pm Post subject: |
|
|
It works great, but I have a feature suggestion: --exclude=/dir
That way the user doesn't have to open the script to add special mountpoints and so forth. (Yes, I know... not following the LSB, but I like having my stash partitions under /stash instead of /mnt/stash |
|
Back to top |
|
|
kamagurka Veteran
Joined: 25 Jan 2004 Posts: 1026 Location: /germany/munich
|
Posted: Sun May 23, 2004 11:44 pm Post subject: |
|
|
currently im having cruft echo its output into a file. this file is then reviewed by me and all that looks fishy removed.
now, however i have a list with paths. anyone know a command to rm each line of a file? _________________ If you loved me, you'd all kill yourselves today.
--Spider Jerusalem, the Word |
|
Back to top |
|
|
ecatmur Advocate
Joined: 20 Oct 2003 Posts: 3595 Location: Edinburgh
|
Posted: Mon May 24, 2004 12:08 am Post subject: |
|
|
Kamagurka wrote: | very nice, thanks.
there are a couple things listed that shouldnt be, though:
1. it lists the whole contents of /usr/share/xmms/Skins (i have xmms installed, though) |
Installed with x11-themes/xmms-themes or by hand?
Quote: | 2. apparenty it doesnt like the icons i put in /usr/share/pixmaps. maybe this is due to a fault of mine, tho. is there a better place to put those? | /usr/pixmaps/local Quote: |
3. is it supposed to list this?
Code: | /etc/gentoo
/etc/gentoo/gentoogtkrc
/etc/gentoo/gentoorc
|
| I don't have that, use my cruft-blame.py to work out what put it there Quote: |
4. it lists /usr/bin/TeamSpeak although i have ts installed. i dont exactly remember if that binary was installed normally, i might have had to put it there manually or something. | I don't think TeamSpeak is in Portage; if not it should be installed to /usr/local/bin or /opt. Quote: |
5. /usr/bin/kill <- i really think i need this... | But you have /bin/kill, don't you? Quote: |
6. it lists a whole load of perl5 and python2.2 stuff. i dont really feel comfortable deleting that. how do i find out what version of perl and python im using? | perl -V, python -V. _________________ No more cruft
dep: Revdeps that work
Using command-line ACCEPT_KEYWORDS? |
|
Back to top |
|
|
ecatmur Advocate
Joined: 20 Oct 2003 Posts: 3595 Location: Edinburgh
|
|
Back to top |
|
|
ecatmur Advocate
Joined: 20 Oct 2003 Posts: 3595 Location: Edinburgh
|
Posted: Mon May 24, 2004 12:14 am Post subject: |
|
|
Kamagurka wrote: | currently im having cruft echo its output into a file. this file is then reviewed by me and all that looks fishy removed.
now, however i have a list with paths. anyone know a command to rm each line of a file? | Actually, cruft now tees its output into /tmp/cruft-cruftfiles.
To rm each line, use "cat file | xargs rm". _________________ No more cruft
dep: Revdeps that work
Using command-line ACCEPT_KEYWORDS? |
|
Back to top |
|
|
kamagurka Veteran
Joined: 25 Jan 2004 Posts: 1026 Location: /germany/munich
|
Posted: Mon May 24, 2004 12:26 am Post subject: |
|
|
ecatmur wrote: | Kamagurka wrote: | currently im having cruft echo its output into a file. this file is then reviewed by me and all that looks fishy removed.
now, however i have a list with paths. anyone know a command to rm each line of a file? | Actually, cruft now tees its output into /tmp/cruft-cruftfiles.
To rm each line, use "cat file | xargs rm". |
bewties!!
and TS is indeed in portage, under the name of teamspeak2-client-bin. _________________ If you loved me, you'd all kill yourselves today.
--Spider Jerusalem, the Word |
|
Back to top |
|
|
ecatmur Advocate
Joined: 20 Oct 2003 Posts: 3595 Location: Edinburgh
|
|
Back to top |
|
|
BlindSpy Apprentice
Joined: 20 Mar 2004 Posts: 263
|
Posted: Mon May 24, 2004 10:57 am Post subject: |
|
|
ecatmur wrote: | Kamagurka wrote: | currently im having cruft echo its output into a file. this file is then reviewed by me and all that looks fishy removed.
now, however i have a list with paths. anyone know a command to rm each line of a file? | Actually, cruft now tees its output into /tmp/cruft-cruftfiles.
To rm each line, use "cat file | xargs rm". |
PERFECT! Thats exactly what I was looking for. This is seriously an obsessive compulsive Gentoo users dream =) !! |
|
Back to top |
|
|
kamagurka Veteran
Joined: 25 Jan 2004 Posts: 1026 Location: /germany/munich
|
Posted: Mon May 24, 2004 11:29 am Post subject: |
|
|
oh, and the xmms skins i have are manually installed, not emerged. i prefer putting them in the shared theme directory instead of the user's one. _________________ If you loved me, you'd all kill yourselves today.
--Spider Jerusalem, the Word |
|
Back to top |
|
|
ecatmur Advocate
Joined: 20 Oct 2003 Posts: 3595 Location: Edinburgh
|
Posted: Mon May 24, 2004 1:26 pm Post subject: |
|
|
The skins you use... would it be possible to switch to using the ebuild or does it lack some skins you need? I'm weighing up adding /usr/share/xmms/Skins to the exclusion list but I would need to be persuaded that this is the best solution. _________________ No more cruft
dep: Revdeps that work
Using command-line ACCEPT_KEYWORDS? |
|
Back to top |
|
|
kamagurka Veteran
Joined: 25 Jan 2004 Posts: 1026 Location: /germany/munich
|
Posted: Mon May 24, 2004 2:51 pm Post subject: |
|
|
there is no "the ebuild", as the xmms-skins ebuild sucks pretty hard. the skins on my systems are all from www.winamp.com, customize.org or deviantart (ah, i love winamp compatibility). i'm pretty sure that is the way most people do this (although some people probably put ~/.xmms/Skins/). however i can't really think of anyting in /usr/share/xmms/Skins/ that would neet to be removed. _________________ If you loved me, you'd all kill yourselves today.
--Spider Jerusalem, the Word |
|
Back to top |
|
|
ecatmur Advocate
Joined: 20 Oct 2003 Posts: 3595 Location: Edinburgh
|
|
Back to top |
|
|
RaveRod n00b
Joined: 20 May 2004 Posts: 17 Location: Brisbane, Australia
|
Posted: Wed May 26, 2004 12:23 am Post subject: |
|
|
Here's the files is identifies wrongly:
/var/run/cron.pid (vixie-cron)
/var/run/klogd.pid (sysklogd)
/var/run/syslogd.pid (sysklogd)
/etc/gentoo-release (Gentoo release file?)
/usr/lib/python2.3/lib-dynload/bz2.so (hmm.. Don't want to delete this I don't think)
This is from a clean install. Just finished the install, restarted, ran cruft script.
Edit:
/var/log/news/news* (startup complains about not being able to find them)
Last edited by RaveRod on Wed May 26, 2004 2:00 am; edited 1 time in total |
|
Back to top |
|
|
hepta_sean Apprentice
Joined: 27 Apr 2004 Posts: 246 Location: Berlin, Germany
|
Posted: Wed May 26, 2004 1:31 am Post subject: |
|
|
Hello!
Another great script of yours, thanks for that!
FYI here are the changes I've done to get zero false positives (as a diff against version 0.0.10):
Code: | 285a286
> /initrd
288d288
< /opt
289a290
> /usr/opt
347a349,352
> $(has_version dev-java/blackdown-jdk \
> || has_version dev-java/sun-j2sdk \
> || has_version dev-java/sun-jdk \
> || has_version dev-java/ibm-jdk && echo "/etc/.java")
373a379,380
> /etc/ntp.conf
> /etc/ntp.conf.sv
444a452
> $(has_version media-libs/gle && echo "/usr/X11R6/include/GL/gle.h")
445a454
> $(has_version media-video/ati-drivers && echo "/usr/X11R6/include/GL/glxATI.h" )
470a480
> /var/run/cron.pid
532a543,547
> has_version dev-util/eclipse-sdk \
> && PRUNE="${PRUNE}
> /usr/lib/eclipse/Uninstaller
> /usr/lib/eclipse/features
> /usr/lib/eclipse/plugins"
549,550c564
< /etc/bootsplash/default
< /etc/bootsplash/gentoo/images/.directory
---
> /etc/bootsplash |
/initrd is added at boot time since I installed bootsplash and hence activated the initial ramdisk. I don't know much about these thingy. Does anyone know, if I can inhibit this or at least convince it to show up in a more appropriate place like e.g. /media/initrd?
I removed /opt from the prune list, 'cause everything I have there (Acrobat, JDKs, OpenOffice) is administrated by portage and I wanted to have that checked for cruft, too.
But on the other hand, I added /usr/opt, which is the "real" place of these. (/opt is just a symlink, because I chose a relatively small root partition and a large /usr and, hence, the /opt things should also go on that partition.)
Do you know a more elegant and/or FHS-conform way to do that?
BTW, does cruft follow symlinks? Or is the /opt hierarchy not checked in the setup sketched above?
/etc/.java is generated everytime I start a Java application as root, and if it's not there and I start it as ordinary user, the application complains. So I guess, it has to be there.
I don't know, where /etc/ntp.conf and /etc/ntp.conf.sv come from (I do not have ntp installed, but they are regenerated, if I delete 'em), but I would guess, that it has something to do with samba, 'cause the IP restrictions are somehow similar.
Does anybody know?
/usr/X11R6/include/GL/gle.h and /usr/X11R6/include/GL/glxATI.h have to be pruned, because the ebuilds install into /usr/include/GL, which is a symlink to /usr/X11R6/include/GL. I guess the glut entry, that was already there has the same reason.
/var/run/cron.pid was not guessed by the script, I don't know, why.
The Eclipse entry is there, because I'm using a UML plugin, which is not in Portage and I didn't want the files (a _lot_) to show up in the cruft output.
Finally, I modified the bootsplash entry, because my handmade bootsplash configuration and a downloaded one were showing up as cruft, and I thought it would be best to ignore the whole directory to allow even more different configurations, as long as bootsplash is installed.
Perhaps, you want to include one or the other, or otherwise point me to why these solutions are not good.
Regards, sean |
|
Back to top |
|
|
ecatmur Advocate
Joined: 20 Oct 2003 Posts: 3595 Location: Edinburgh
|
Posted: Wed May 26, 2004 5:53 pm Post subject: |
|
|
RaveRod wrote: | Here's the files is identifies wrongly:
/var/run/cron.pid (vixie-cron)
/var/run/klogd.pid (sysklogd)
/var/run/syslogd.pid (sysklogd)
/etc/gentoo-release (Gentoo release file?)
/usr/lib/python2.3/lib-dynload/bz2.so (hmm.. Don't want to delete this I don't think)
This is from a clean install. Just finished the install, restarted, ran cruft script.
Edit:
/var/log/news/news* (startup complains about not being able to find them) | OK... um, /var/log/news/news* - do you know what package that belongs to? _________________ No more cruft
dep: Revdeps that work
Using command-line ACCEPT_KEYWORDS? |
|
Back to top |
|
|
|
|
Gentoo Forums Forum Index
Documentation, Tips & Tricks |
All times are GMT Goto page Previous 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 Next
|
Page 4 of 10 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|