Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
program to clean up temporary dirs (/tmp /var/tmp)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
samureye
n00b
n00b


Joined: 11 Jul 2002
Posts: 15

PostPosted: Thu Mar 13, 2003 3:11 am    Post subject: program to clean up temporary dirs (/tmp /var/tmp) Reply with quote

Hello,

I'm looking for a program (not fussy on what it's written in) that will clean out temporary directories/files, taking into consideration the file/directories'

age (atime, ctime or mtime)
type of file (socket, file, directory, symlink)
if the file is in use
if the files' uid does not resolve
if the file is a symlink, is it 'dangling'

Does anyone know of any programs out there that would achieve this?! If not, I might have to write my own!

Thanks :)
Back to top
View user's profile Send private message
Chris W
l33t
l33t


Joined: 25 Jun 2002
Posts: 972
Location: Brisbane, Australia

PostPosted: Thu Mar 13, 2003 5:18 am    Post subject: Reply with quote

Write an rc or cron script built around what you find here:
Code:

$ man find
$ man xargs


For example:
Code:

find /tmp -type f -mtime +7 | xargs rm

_________________
Cheers,
Chris W
"Common sense: The collection of prejudices acquired by age 18." -- Einstein
Back to top
View user's profile Send private message
samureye
n00b
n00b


Joined: 11 Jul 2002
Posts: 15

PostPosted: Thu Mar 13, 2003 5:56 am    Post subject: Reply with quote

Thanks Chris.

I was hoping there was some programs already out there that do the trick. I have a perl script that does the job.. just wanted to know if there is something out there that is better.

Chris W wrote:
Write an rc or cron script built around what you find here:
Code:

$ man find
$ man xargs


For example:
Code:

find /tmp -type f -mtime +7 | xargs rm
Back to top
View user's profile Send private message
ozric100
Tux's lil' helper
Tux's lil' helper


Joined: 23 Apr 2002
Posts: 136

PostPosted: Thu Mar 13, 2003 8:34 pm    Post subject: Reply with quote

emerge -s tmpwatch

I don't know if its still masked.(at work XP-pro.. barf). I cron it everyday or so. Its been fine for me.
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20067

PostPosted: Thu Mar 13, 2003 9:09 pm    Post subject: Reply with quote

Some more info on tmpwatch and cleaning tmp dirs.
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
samureye
n00b
n00b


Joined: 11 Jul 2002
Posts: 15

PostPosted: Thu Mar 13, 2003 10:52 pm    Post subject: Reply with quote

Thanks for the assistance guys :)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming 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