cleaning /tmp directory

Adalbert Prokop adalbert.prokop at gmx.de
Wed Mar 31 13:58:59 UTC 2010


Am 31.03.2010 15:52, schrieb Maurizio Marini:

Hi!

> i need a cron script that cleans every day crap into /tmp
> I have there a lot of temp files but i dunno which ones can be safely wiped,
> and it is very time comsuming job, too.
> Any script written by someone of you will be very apreciated :)

There is no need to reinvent the wheel. Fedora comes with tmpwatch, 
which does exactly what you want - scans /tmp (and possibly other 
directories) and deletes unused files.

I do not have access to my computer right now, but "man tmpwatch" should 
help you.

If I'm not mistaken, tmpwatch is called regularly by cron from 
/etc/cron.daily (?).

-- 
bye
Adalbert


More information about the users mailing list