Gentoo – Utilities tmpwatch and flagedit

Gentoo - Utilities tmpwatch and flageditGentoo users eventually branch out from the utilites Portage gives to do more advanced tasks, quicker. There are a good number of these utilites in the Portage tree including tmpwatch and flagedit.


tmpwatch is just as it sounds and wipes specified directories. Baselayout does have the bootmisc that can wipe /tmp.



To wipe other directories like portage’s temporary directory, tmpwatch can be used. Tmpwatch can wipe based on several different time criteria, most useful being -mtime and -atime. -mtime is the modification time and -atime is the access time. Most people have atime disabled in their /etc/fstab file which isn’t used much for desktop system. Access time writes are writes everytime a file is accessed a process that can really bottleneck I/O on busy systems. Tmpwatch is in portage:

emerge tmpwatch

Tmpwatch is a basic cronjob and will need to be edited.

sudo vim /etc/cron.daily/tmpwatch

The file is pretty well commented and provides examples to wipe /tmp, wipe package sources (distfiles), the portage tmp directory…

Like I said most people will probably want to change -atime to -mtime.

if [[ -d /tmp ]]; then
    ${TMPWATCH} --exclude-user username --mtime 24 /tmp

Units are in hours measures.


emerge flagedit

Flagedit hasn’t been developed for two years so “I hope you know what you’re doing” will be spit out everytime changing the USE flags. Yes, I know what I’m doing. That said add or subtracting USE flags works just fine.

Edit global USE flags:

flagedit +alsa
flagedit -alsa
flagedit %alsa

This adds, subtracts and prunes the alsa USE flag globally in Portage. Adding USE flags globally edits the /etc/make.conf while adding USE flags locally edits /etc/portage/package.use on a per package basis. To add flags locally:

flagedit www-servers/lighttpd php fastcgi

About Gen2ly

<3's linux

Posted on 2008-03-27, in Gentoo. Bookmark the permalink. 2 Comments.

  1. Thanks flagedit seems to be very useful to me!
    also,I’d like to know whether I can finish my installation of Gentoo using sysrescuecd ?

  2. I think so. Any LiveDVD, CD, Min CD is possible to use as the only necessary part is switching environments. Keep in mind the Gentoo 2008 beta was just release a couple days ago. no sl

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Get every new post delivered to your Inbox.

Join 58 other followers

%d bloggers like this: