View previous topic :: View next topic |
Author |
Message |
Pseud Apprentice
Joined: 19 Mar 2004 Posts: 273 Location: Bangalore, India
|
Posted: Sat Jul 09, 2005 4:27 am Post subject: |
|
|
Just a small issue you might want to fix up:
When run as a non-root user, since /var/log/portage is denied access, the following doesn't work right:
Code: | # ./yacleaner -p log
[...]
* /var/log/portage is already clean.
|
Great script otherwise, thanks! _________________ eschew obfuscation |
|
Back to top |
|
|
tacvbo n00b
Joined: 28 May 2003 Posts: 39 Location: México City
|
Posted: Sat Jul 09, 2005 5:55 am Post subject: |
|
|
Pseud wrote: | Just a small issue you might want to fix up:
When run as a non-root user, since /var/log/portage is denied access, the following doesn't work right:
|
Could you post the output of a:
Code: | ls -lda /var/log/portage |
You are in the portage group?
Pseud wrote: | Great script otherwise, thanks! |
Thanks for using it |
|
Back to top |
|
|
Pseud Apprentice
Joined: 19 Mar 2004 Posts: 273 Location: Bangalore, India
|
Posted: Sat Jul 09, 2005 6:49 am Post subject: |
|
|
Ahh! you're right ... its my permissions that are probably wrong:
Code: | $ ls -lda /var/log/portage/
drwxrws--- 2 root root 30080 Jul 9 12:56 /var/log/portage/
|
I wonder where else on my system I (wrongly) have gid=root instead of gid=portage...
Is there a way I can find this out? _________________ eschew obfuscation |
|
Back to top |
|
|
tacvbo n00b
Joined: 28 May 2003 Posts: 39 Location: México City
|
Posted: Sat Jul 09, 2005 7:02 am Post subject: |
|
|
Pseud wrote: | Ahh! you're right ... its my permissions that are probably wrong:
Code: | $ ls -lda /var/log/portage/
drwxrws--- 2 root root 30080 Jul 9 12:56 /var/log/portage/
|
I wonder where else on my system I (wrongly) have gid=root instead of gid=portage...
Is there a way I can find this out? |
Re-download yacleaner-3.0 its fixed now, it shows this msg:
Code: | * You don't have permission to access /var/log/portage.
Perhaps you are not in 'portage' group?.
|
Hmm.. maybe you just should have root:portage perms on: /usr/portage/distfiles and /var/log/portage. |
|
Back to top |
|
|
radfoj Guru
Joined: 31 Dec 2004 Posts: 490 Location: Tísek, Czech Republic
|
Posted: Sat Jul 09, 2005 6:41 pm Post subject: Re: Version 0.3 "Release early and often" is out! |
|
|
tacvbo wrote: |
* Now just remove old logs and worktmp files rather than clean all the log and tmp dir. |
Hi, what do you mean with "remove old worktmp"? I am playing with worktmp module and
Code: | yacleaner-0.3.1 --ask --verbose worktmp
........
[ total ] +179 M
|
About 99 % from /var/tmp/portage was deleted and only 7 directories remain (dirs from interupted or unfinished emerge).
BTW: are my questions posted here redundant, crazy, stupid ... ? |
|
Back to top |
|
|
tacvbo n00b
Joined: 28 May 2003 Posts: 39 Location: México City
|
Posted: Sat Jul 09, 2005 8:49 pm Post subject: Re: Version 0.3 "Release early and often" is out! |
|
|
radfoj wrote: | Hi, what do you mean with "remove old worktmp"?
About 99 % from /var/tmp/portage was deleted and only 7 directories remain (dirs from interupted or unfinished emerge). |
+179 M are a good amount of new free space
It should delete all dirs inside ${PORTAGE_TMPDIR}/portage which doesn't have a corresponding package installed.
For example:
I have installed rpc-0.98 and xfce4-windowlist-0.1.0-r1.
Code: | $ ls /var/tmp/portage
rpc-0.97 rpc-0.98 xfce4-windowlist-0.1.0-r1 xfce4-windowlist-0.1.0-r4 |
Then, rpc-0.97 and xfce4-windowlist-0.1.0-r4 will be erased.
In fact all `modules` for yacleaner work in that way (dist, binpkg, log, worktmp). |
|
Back to top |
|
|
radfoj Guru
Joined: 31 Dec 2004 Posts: 490 Location: Tísek, Czech Republic
|
Posted: Sat Jul 09, 2005 10:05 pm Post subject: Re: Version 0.3 "Release early and often" is out! |
|
|
tacvbo wrote: |
It should delete all dirs inside ${PORTAGE_TMPDIR}/portage which doesn't have a corresponding package installed.
|
Thanks for reply. I was worrying about fact, why after I run it, only 7 dirs remained, although I have +-500 packages on system. I am stupid boy, I tried to reemerge one package right now to see what happens in /var/tmp/portage. After succesully merge, everything related to this emerge was deleted by portage itself.
Sorry, I missed how portage behaves these days Really stupid question from me. |
|
Back to top |
|
|
tacvbo n00b
Joined: 28 May 2003 Posts: 39 Location: México City
|
Posted: Sun Jul 10, 2005 12:02 am Post subject: Re: Version 0.3 "Release early and often" is out! |
|
|
radfoj wrote: |
I tried to reemerge one package right now to see what happens in /var/tmp/portage. After succesully merge, everything related to this emerge was deleted by portage itself.
|
That is the correct Portage behaviour if you don't have set FEATURES="keeptemp", So the worktmp cleaning process of yacleaner is just for users who have that portage's feature enabled. Anyway it seems that there is a little portage bug because dyn_clean() function (where ${T} are cleaned) it's being ran at the wrong time when {up,down}grading, so sometimes you have "orphaned" files inside ${PORTAGE_TMPDIR}/portage even if you dont have FEATURES="keeptemp" set. |
|
Back to top |
|
|
Turd Furguson n00b
Joined: 16 Jun 2005 Posts: 49
|
Posted: Sun Jul 10, 2005 5:43 am Post subject: |
|
|
I am very new to Linux so I do not know how to execute this program. I have it saved as a text file currently but have no clue what to do. |
|
Back to top |
|
|
whitesouls Guru
Joined: 19 Nov 2004 Posts: 358 Location: In Front of My Laptop
|
Posted: Sun Jul 10, 2005 11:30 am Post subject: |
|
|
...I ran this programme and i got this:
[code]VaderX Cruft # ./yacleaner.sh --verbose --ask all
These are the old files that I would delete:
Quote: |
[ worktmp ] Archive-Zip-1.14 72K
[ worktmp ] Compress-Zlib-1.33 72K
[ log ] 3493-spamassassin-3.0.4.log 28K
[ log ] 3494-spamassassin-3.0.4.log 4.0K
[ log ] 3614-spamassassin-3.0.4.log 0
[ log ] 2419-sysfsutils-0.4.0.log 40K
[ log ] 2420-sysfsutils-0.4.0.log 0K |
EDIT: Sorry for making this post very long. _________________ whitesouls
Please insert the [SOLVED] tag if your problem is solved in your respective thread.
Last edited by whitesouls on Mon Aug 01, 2005 11:12 am; edited 1 time in total |
|
Back to top |
|
|
StringCheesian l33t
Joined: 21 Oct 2003 Posts: 887
|
Posted: Sun Jul 10, 2005 4:01 pm Post subject: |
|
|
Turd Furguson wrote: | I am very new to Linux so I do not know how to execute this program. I have it saved as a text file currently but have no clue what to do. |
Most scripts like this have no graphical interface, which means nothing will happen if you just double-click it. You have to run them from a console (translated to Windows-ian: "command prompt window". like xterm, konsole, or gnome-terminal) to see the text they print out.
First open a console, then type: Code: | cd the_directory_that_you_saved_the_file_in |
This will make the script executable: Code: | chmod +x ./whatever_filename_you_saved_it_as |
And then you can run it like this: Code: | ./whatever_filename_you_saved_it_as |
And that goes for just about any linux script. You just have to make it executable after you download it.
BTW, this paticular script needs root permission in order to delete files. To become root type "su", enter your root password, and then run the script. |
|
Back to top |
|
|
Turd Furguson n00b
Joined: 16 Jun 2005 Posts: 49
|
Posted: Mon Jul 11, 2005 3:46 am Post subject: |
|
|
Thank you for explaining.
Here is the error I am receiving now:
laptop nate # ./yacleaner.sh
./yacleaner.sh: line 1: !/bin/bash: No such file or directory
./yacleaner.sh: line 312: syntax error near unexpected token `newline'
./yacleaner.sh: line 312: ` echo eval rm -rf \"`eval_this portage ${1}` files\" >> '
I did a dir command at the prompt and it is showing the yacleaner.sh script being present in my home folder.
laptop nate # dir
Desktop cedega_4.3.2-1.i386.tgz
c yacleaner.sh
cannon.gif |
|
Back to top |
|
|
tacvbo n00b
Joined: 28 May 2003 Posts: 39 Location: México City
|
Posted: Mon Jul 11, 2005 4:05 am Post subject: |
|
|
Lord Vader wrote: | ...I ran this programme and i got this:
[code]VaderX Cruft # ./yacleaner.sh --verbose --ask all
These are the old files that I would delete:
[ worktmp ] Archive-Zip-1.14 72K
[ worktmp ] Compress-Zlib-1.33 72K
|
And what's the problem? All of them are old files, so.. don't worry they could be deleted. |
|
Back to top |
|
|
Turd Furguson n00b
Joined: 16 Jun 2005 Posts: 49
|
Posted: Tue Jul 12, 2005 6:33 am Post subject: |
|
|
I am trying your 0.4 alpha build and am receiving a few odd things....
>>> Deleting old files...
* /var/tmp/portage cleaned.
* The $PORT_LOGDIR variable is not set.
* /usr/portage/distfiles was already clean.
* The directory /usr/portage/packages do not exist.
I don't know if that is how it is supposed to react or not. |
|
Back to top |
|
|
whitesouls Guru
Joined: 19 Nov 2004 Posts: 358 Location: In Front of My Laptop
|
Posted: Tue Jul 12, 2005 7:41 pm Post subject: |
|
|
tacvbo wrote: | Lord Vader wrote: | ...I ran this programme and i got this:
[code]VaderX Cruft # ./yacleaner.sh --verbose --ask all
These are the old files that I would delete:
[ worktmp ] Archive-Zip-1.14 72K
[ worktmp ] Compress-Zlib-1.33 72K
|
And what's the problem? All of them are old files, so.. don't worry they could be deleted. |
3GB went off?? .. thank you tacvbo..i've managed to save 3GB juz like that... ... 2 thumbs up for this program!!! _________________ whitesouls
Please insert the [SOLVED] tag if your problem is solved in your respective thread. |
|
Back to top |
|
|
tacvbo n00b
Joined: 28 May 2003 Posts: 39 Location: México City
|
Posted: Tue Jul 12, 2005 11:48 pm Post subject: |
|
|
Turd Furguson wrote: | I am trying your 0.4 alpha build and am receiving a few odd things....
>>> Deleting old files...
* /var/tmp/portage cleaned.
* The $PORT_LOGDIR variable is not set.
* /usr/portage/distfiles was already clean.
* The directory /usr/portage/packages do not exist.
I don't know if that is how it is supposed to react or not. |
That's OK, |
|
Back to top |
|
|
gwolf Guru
Joined: 05 May 2005 Posts: 374 Location: Estonia
|
Posted: Wed Jul 13, 2005 6:59 am Post subject: Re: Version 0.3 "Release early and often" is out! |
|
|
tacvbo wrote: |
Grab it here: yacleaner-0.3 and please post your comments, patches and suggestions. |
Big thanks, it really has all the features I need atm
Only one suggestion: create an ebuild and add it into portage _________________ War is peace. Freedom is slavery. Ketchup is a vegetable. |
|
Back to top |
|
|
Bodri n00b
Joined: 04 May 2005 Posts: 26
|
Posted: Sun Jul 17, 2005 12:58 am Post subject: |
|
|
I think move (with destination folder) would be a nice new action.
THX |
|
Back to top |
|
|
neworld n00b
Joined: 17 Jul 2005 Posts: 1 Location: Mass
|
Posted: Sun Jul 17, 2005 1:21 am Post subject: Small suggestion |
|
|
Works well the only thing about it is that it doesn't support multiple options together
ie: yacleaner -av dist
here is one solution to change the parsing of the options in the script to:
Code: | while getopts adhpvVc o
do case "$o" in
a ) ask_pretend="ask";;
d ) action_delete="yes";;
h ) option_help="yes";;
c ) option_color="no";;
p ) verb="is"; ask_pretend="pretend";;
v ) option_verbose="yes";;
V ) option_version="yes";;
* ) OPTIND=$i; should_exit="yes" ; show_help "${!i} is an invalid option"; break ;;
esac
done
for ((i=$OPTIND; i<=$#; ++i)); do
case ${!i} in
--ask ) ask_pretend="ask";;
--delete ) action_delete="yes";;
--help ) option_help="yes";;
--nocolor ) option_color="no";;
--pretend ) verb="is"; ask_pretend="pretend";;
--verbose ) option_verbose="yes";;
--version ) option_version="yes";;
binpkg ) delete_argument="binpkg ${delete_argument}" ;;
dist ) delete_argument="dist ${delete_argument}" ;;
log ) delete_argument="log ${delete_argument}" ;;
worktmp ) delete_argument="worktmp ${delete_argument}" ;;
all ) delete_argument="binpkg dist log worktmp" ;;
-* ) ;;
* ) OPTIND=$i; should_exit="yes" ; show_help "${!i} is an invalid option"; break ;;
esac
done |
this works all i had to do was make the short option for --nocolor be -c _________________ -neworld |
|
Back to top |
|
|
whitesouls Guru
Joined: 19 Nov 2004 Posts: 358 Location: In Front of My Laptop
|
Posted: Sun Jul 17, 2005 4:27 pm Post subject: |
|
|
Good luck for the great job. just a suggestion only. Why dont you maintain a ebuild like conky? That would be cool, dude. I knw the program is only 16kb but having an ebuild would be betteri guess _________________ whitesouls
Please insert the [SOLVED] tag if your problem is solved in your respective thread. |
|
Back to top |
|
|
tacvbo n00b
Joined: 28 May 2003 Posts: 39 Location: México City
|
Posted: Wed Jul 20, 2005 10:42 pm Post subject: Re: Small suggestion |
|
|
Bodri wrote: | I think move (with destination folder) would be a nice new action. |
I like the idea, most probably will be in v4. I will work on it on yacleaner-0.4.1alpha
neworld wrote: | Works well the only thing about it is that it doesn't support multiple options together
ie: yacleaner -av dist
|
yacleaner-0.4.1alpha now support multiple short options together, so the next stable version, will have that support.
Lord Vader wrote: | Good luck for the great job. just a suggestion only. Why dont you maintain a ebuild like conky? That would be cool, dude. I knw the program is only 16kb but having an ebuild would be betteri guess |
Humm, I will think about it, but I beleive that is better that some tool like this is get inside gentoolkit.
Thanks to all for your comments and suggestions!
PD: If you use yacleaner-0.4.1alpha see the ToDo List and dropme a line (here or in my mail) with you comments and rembember that is alpha code, so take care. |
|
Back to top |
|
|
lefou Apprentice
Joined: 18 Feb 2004 Posts: 199 Location: Germany, Lusatia
|
Posted: Thu Jul 21, 2005 7:44 am Post subject: |
|
|
This is my small but working ebuild
Code: | # Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
inherit eutils
DESCRIPTION="Yet Another Cleaner - unsupported portage file cleaner."
HOMEPAGE="http://gentoo.org.mx/yacleaner/"
LICENSE="GPL"
SLOT="0"
KEYWORDS="~x86"
IUSE=""
DEPEND="sys-apps/portage"
MY_P=${P/_alpha1/alpha}
SRC_URI="http://gentoo.org.mx/yacleaner/${MY_P}"
src_unpack() { :; }
src_compile() { :; }
src_install() {
newbin ${DISTDIR}/${MY_P} ${PN} || die "failed to copy ${P}"
}
|
lefou |
|
Back to top |
|
|
tacvbo n00b
Joined: 28 May 2003 Posts: 39 Location: México City
|
Posted: Thu Jul 21, 2005 7:51 am Post subject: |
|
|
lefou wrote: | This is my small but working ebuild |
Cool! Thanks |
|
Back to top |
|
|
Pseud Apprentice
Joined: 19 Mar 2004 Posts: 273 Location: Bangalore, India
|
Posted: Fri Jul 22, 2005 6:06 am Post subject: |
|
|
@Lord Vader:
Could you kindly edit that huge post of yours (somewhere up in the middle of this page) and shorten it? It fills up a lot of space and doesn't provide much information to others browsing through the pages. Thanks. _________________ eschew obfuscation |
|
Back to top |
|
|
Smoothhound Tux's lil' helper
Joined: 23 Sep 2003 Posts: 149
|
Posted: Fri Jul 22, 2005 11:19 am Post subject: |
|
|
I think I have found a buglet:
Code: | [root@haggis util]\$ ./yacleaner-0.4.1alpha --pretend --delete worktmp
These are the old worktmp files that I would delete:
[ worktmp ] B
./yacleaner-0.4.1alpha: line 353: 0 + 0 + 0 + : syntax error: operand expected (error token is " ")
[root@haggis util]\$ ./yacleaner-0.3 --pretend --delete worktmp
These are the old worktmp files that I would delete:
[ worktmp ] B
./yacleaner-0.3: line 335: 0 + 0 + 0 + : syntax error: operand expected (error token is " ")
|
Works for all other options. Note that I've got no idea what "worktmp" is and whether indeed I have one but it probably ought to fail a bit more gracefully
Apart from that, cheers! I cleared out ~0.8G of stuff with it |
|
Back to top |
|
|
|