When run as a non-root user, since /var/log/portage is denied access, the following doesn't work right:
Code: Select all
# ./yacleaner -p log
[...]
* /var/log/portage is already clean.
Code: Select all
# ./yacleaner -p log
[...]
* /var/log/portage is already clean.
Could you post the output of a: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:
Code: Select all
ls -lda /var/log/portageThanks for using itPseud wrote:Great script otherwise, thanks!
Code: Select all
$ ls -lda /var/log/portage/
drwxrws--- 2 root root 30080 Jul 9 12:56 /var/log/portage/
Re-download yacleaner-3.0 its fixed now, it shows this msg:Pseud wrote:Ahh! you're right ... its my permissions that are probably wrong:I wonder where else on my system I (wrongly) have gid=root instead of gid=portage...Code: Select all
$ ls -lda /var/log/portage/ drwxrws--- 2 root root 30080 Jul 9 12:56 /var/log/portage/
Is there a way I can find this out?
Code: Select all
* You don't have permission to access /var/log/portage.
Perhaps you are not in 'portage' group?.
Hi, what do you mean with "remove old worktmp"? I am playing with worktmp module andtacvbo wrote: * Now just remove old logs and worktmp files rather than clean all the log and tmp dir.
Code: Select all
yacleaner-0.3.1 --ask --verbose worktmp
........
[ total ] +179 M
+179 M are a good amount of new free spaceradfoj 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).
Code: Select all
$ ls /var/tmp/portage
rpc-0.97 rpc-0.98 xfce4-windowlist-0.1.0-r1 xfce4-windowlist-0.1.0-r4Thanks 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.tacvbo wrote: It should delete all dirs inside ${PORTAGE_TMPDIR}/portage which doesn't have a corresponding package installed.
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.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.


Code: Select all
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[/quote]
[b]EDIT:[/b] Sorry for making this post very long. :D
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.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.
Code: Select all
cd the_directory_that_you_saved_the_file_inCode: Select all
chmod +x ./whatever_filename_you_saved_it_asCode: Select all
./whatever_filename_you_saved_it_as
Lord Vader wrote:...I ran this programme and i got this:
Code: Select all
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 [/quote] And what's the problem? All of them are old files, so.. don't worry they could be deleted.


tacvbo wrote:Lord Vader wrote:...I ran this programme and i got this:
Code: Select all
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 [/quote] And what's the problem? All of them are old files, so.. don't worry they could be deleted.[/quote] [b]3GB[/b] went off??8O .. thank you tacvbo..i've managed to save 3GB juz like that...:D ... 2 thumbs up for this program!!!
That's OK,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.
Big thanks, it really has all the features I need atmtacvbo wrote: Grab it here: yacleaner-0.3 and please post your comments, patches and suggestions.
Code: Select all
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
I like the idea, most probably will be in v4. I will work on it on yacleaner-0.4.1alphaBodri wrote:I think move (with destination folder) would be a nice new action.
yacleaner-0.4.1alpha now support multiple short options together, so the next stable version, will have that support.neworld wrote:Works well the only thing about it is that it doesn't support multiple options together
ie: yacleaner -av dist
Humm, I will think about it, but I beleive that is better that some tool like this is get inside gentoolkit.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
Code: Select all
# 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}"
}

Code: Select all
[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 " ")