Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
quick tip: keeping temp files under control
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
rhill
Retired Dev
Retired Dev


Joined: 22 Oct 2004
Posts: 1629
Location: sk.ca

PostPosted: Tue Dec 07, 2004 8:31 am    Post subject: quick tip: keeping temp files under control Reply with quote

just a quick little tip. i use a util called "tmpwatch" to keep a few of my temp/cache/distfiles dirs under control. just 'emerge tmpwatch'. it will recursively search a directory and delete any files older than how many hours you specify. it can also check if the file is in use first using fuser. by default it uses access times to check, so if you have your partitions mounted "noatime", be sure to either remount them without that option or use the -m (modified time) option with tmpwatch.

here's a ghetto script.

Code:
#!/bin/bash

tmpwatch -vs 168 /tmp
tmpwatch -vs 168 /var/log/portage
tmpwatch -vs 168 /var/tmp/portage
tmpwatch -mvs 168 /usr/portage/distfiles


this deletes any temp files i have if nothing has touched them in a week.

note: don't use the -m option on /var/tmp/portage. since the files that are extracted there keep their original time stamps, the modified date will almost always be older than one week, and the script will delete them, even if you've just extracted them and even if you're in the middle of an emerge.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
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