Cleanup Utility...

Discuss all artwork and development - Suggestions needed

Moderator: Moderators

Cleanup Utility...

Postby Darksurf » Fri Jul 27, 2007 19:30

I think we need a clean up utility. Something that will delete old logs and crap from /var/log ,/tmp, /home/{user}/.Thumbnails ect. I think you catch my drift. Those folders always bog down my HD. Any folder that gathers stuff over time that is pretty much meaningless to the normal user should be able to be cleared. That could clear up a lot of space for people on the HD after some time.
~ Y </0 5+Up1</ P30p[Ez +Ry 2 R34</ D1s? ~
Darksurf
Old Dear Hen
 
Posts: 782
Joined: Sat Sep 16, 2006 4:01

Postby Cypher_FTW » Sat Aug 04, 2007 14:55

That sort of thing wouldnt be too hard. You could just write a couple of scripts for removing the logs and such, though i would only remove the non-current logs. Then just make a cron job to run it automatically. I'm sure there may be someone here or on the IRC channel to help you out if you are unfamilliar with scripts.
Cypher_FTW
Baby Hen
 
Posts: 3
Joined: Tue Jul 24, 2007 14:10
Location: Australia

Postby WarraWarra » Sat Aug 04, 2007 18:18

One of the links in the usb thumb drive thingy I am working on has the commands but it needs to be combined into 1 script and obviously not remove needed stuff / fine tuned.

http://www.sabayonlinux.org/forum/viewtopic.php?t=8995

Funny that there is not something like this already for gentoo based distro's.
WarraWarra
Sagely Hen
 
Posts: 1989
Joined: Wed Jan 03, 2007 21:01
Location: 31.324270, -113.585511

Postby DontPanic » Mon Aug 06, 2007 15:57

For my .thumbnails directory, I sometimes cron a command that would delete files older than sixty days (which equals 86400 minutes)

Code: Select all
find .thumbnails/ -type f -mmin +86400 -exec rm -f {} ';'


However, I admit rolling my own automated deleting routines always makes me a touch nervous. :roll:

Note: If you decide to use this command, please test your syntax carefully without the "-exec rm -f {} ';'" portion first.
DontPanic
Old Dear Hen
 
Posts: 742
Joined: Mon Jul 09, 2007 20:29
Location: Mobile, AL, USA

Postby Darksurf » Mon Aug 06, 2007 18:26

Yeah, but not all users know how to make a script... Most n00bs don't even know what they're doing...
This helps make the OS a bit more n00b friendly without turning into a windows like piece of junk.

Oh, and I also forgot to mention the folder /usr/portage/distfiles Dang... I emerge soo much big stuff that one fill my hard drive the most!! I need to clear it about 1 month to free more than 1gig of data.
~ Y </0 5+Up1</ P30p[Ez +Ry 2 R34</ D1s? ~
Darksurf
Old Dear Hen
 
Posts: 782
Joined: Sat Sep 16, 2006 4:01

Postby DontPanic » Mon Aug 06, 2007 23:12

I ran across another great script in the gentoo forums that cleans your distfiles directory, deleting only outdated files. It can also remove old binary files on /usr/portage/packages, remove old temporary files on /usr/tmp/portage, and remove old log files on $PORT_LOGDIR, depending on the options you specify. It also has options for --pretend and --ask, so you can see if you like what it's about to delete.

It's named yacleaner. Unfortunately, it seems to have been abandoned by it's developer (he seems to have left the gentoo scene). Some people have posted patches to keep the script working with the changes in portage, but no-one seems to have adopted the script and published a full version that you don't have to go back and patch by hand.

I've been using a version of the script that I patched based on postings in the gentoo forum, and it seems to work great. The standard cleaner (eclean) that comes with gentoolkit misses lots of files, but this script seems to catch all the ones that eclean misses. As you say, if you've been busy updating, it's common to free up half a gig.

I've thought about posting my updated version of this script, since the original author released it under the GNU GPL v2 license. But I'm not sure of the best way to go about that to acknowledge that it is primarily other peoples work. It probably wouldn't be kosher for me to keep the yacleaner name and increment the rev number somehow. Or would it be OK for me to take the author's last revision number and modify it somehow?
DontPanic
Old Dear Hen
 
Posts: 742
Joined: Mon Jul 09, 2007 20:29
Location: Mobile, AL, USA

Postby Fitzcarraldo » Tue Aug 07, 2007 12:08

^You could rename your modified version of the script to something like "yacleaner+" and start the revision numbering from 0.1, 1.0 or whatever you want. Also, I'd put comments in the header of the script acknowledging its original name, the name/pseudonym of the original developer and URL of the Web page where it was posted, mention the GPL licence, and so on. If the developer released it under a GPL then you are free to fork it.

"When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs
; and that you know you can do these things."
[GNU GPL Version 2, June 1991]
User avatar
Fitzcarraldo
Sagely Hen
 
Posts: 7981
Joined: Sat Mar 10, 2007 5:40
Location: United Kingdom

Postby Darksurf » Tue Aug 07, 2007 18:08

I don't know anything about programming, or much about bash scripting (I can do a little....obviously), but if there is anything I can do to help out, I'd work on such a project. I'd learn whatever U have to offer and help with what I could. I think a nice little cleaner app with a GUI would be nice for sabayon. It would be a nice contribution to Sabayon Linux , I think. It'd be user friendly for n00bs, but not like the winblows cleaner that doesn't do much good at all. Is there somewhere I can download Ur modded script of yacleaner?? I'd like to look at it and see if I could edit the script some. Maybe learn a little about making a simple GUI for it (if thats even possible for n00b to programming like me), but I plan on learn a little java (which, to tell U the truth I hate java, but it has been getting better...) this year, and already have a large book over java programming.
~ Y </0 5+Up1</ P30p[Ez +Ry 2 R34</ D1s? ~
Darksurf
Old Dear Hen
 
Posts: 782
Joined: Sat Sep 16, 2006 4:01

Postby DontPanic » Tue Aug 07, 2007 18:40

The script is not too long, only about 16k/544 lines. I could post the entire script here (if that isn't too long), or I wouldn't mind putting it up on my server.

I was thinking of renaming my adapted version as: yaocleaner (Yet Another Orphaned Cleaner)

I modified the original header as follows (but I wasn't sure how to update Gentoo's Copyright, and I don't know the full name of the forum user who provided the patch):

Code: Select all
#!/bin/bash
#http://forums.gentoo.org/viewtopic-t-337074-postdays-0-postorder-asc-start-0.html
# Copyright 2003-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
#
#     Yet Another (Orphaned) Cleaner tool for Gentoo/Sabayon
#
#     Adopted/Adapted from Gentoo's yacleaner
#
#     Based on discussion in the above forum topic, this useful tool
#     has been lacking attention by the original author, however,
#     forum users have posted patches that continue to provide functionality
#     for this script.
#
# Orignal Author:
#       Octavio Ruiz (Ta^3) <[email protected]>
# Parts of Code by:
#       Ed Catmur <[email protected]>
# Edited to incorporate user supplied patches by:
#       Mitchell Harder <mmharder at gmail.com>
# Modifications/Patches to i_dist() function Provided by:
#       GladRags (see above referenced forum discussion)
# Thanks:
#       Konstantin Shaposhnikov <[email protected]>
#       Thomas de Grenier de Latour <[email protected]>
#
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY. YOU USE AT YOUR OWN RISK. THE AUTHOR
# WILL NOT BE LIABLE FOR DATA LOSS, DAMAGES, LOSS OF PROFITS OR ANY
# OTHER  KIND OF LOSS WHILE USING OR MISUSING THIS SOFTWARE.
# See the GNU General Public License for more details.

prog_name="yaocleaner"
prog_version="0.5beta-2"


Let me know what you think of this header, and I'll put this script out there for you to play with.
DontPanic
Old Dear Hen
 
Posts: 742
Joined: Mon Jul 09, 2007 20:29
Location: Mobile, AL, USA

Postby Darksurf » Tue Aug 07, 2007 19:06

I like it. Its kinda catchy and make since. yaocleaner.... I like the idea of TAOcleaner "Technically Another Orphaned Cleaner" and we can use some kind of TAO symbol for the icon. Here are a couple of examples we could use for icons. Keep in mind, these pics will be much smaller so they won't look cheesy when we shrink them to icon size.

I also think U could attach that script as an attachment instead of posting/pasting it here. I think it should fit. Most jpegs posted are bigger than that so I don't see anything against it.
~ Y </0 5+Up1</ P30p[Ez +Ry 2 R34</ D1s? ~
Darksurf
Old Dear Hen
 
Posts: 782
Joined: Sat Sep 16, 2006 4:01

Next

Return to Artwork and Development Suggestions

Who is online

Users browsing this forum: No registered users and 1 guest

cron