Re: Annoying tmp files on shared host
Chris Martin <[email protected]>
| Newsgroups | gmane.org.user-groups.linux.pdxlug |
|---|---|
| Message-ID | <[email protected]> |
Cliff Wells wrote: > On Sat, 2004-08-28 at 10:01, Chris Martin wrote: > >>I host a site on a shared server that, recently, is constantly sending >>me emails about running out of space. This account is a small (100MB) >>account, and when I go into cPanel and look at the disk usage, >>/tmp/urchin is usually the culprit (most of the time > 75MB). >>I cleared them out Wed, and by yesterday it was full again. >> >>I was going to complain to my host about it, but then I realized I >>wasn't sure how those were supposed to be cleared out. >>I wasn't sure if they were supposed to auto-magically evaporate, or if I >>should setup a cron job or something. I've never run into this before so >>I was hoping one of you might be able to shine some light on it. > > > Not heavily tested (I ran it twice), but attached is a Python script > that uses lsof to get a list of open files in a directory, then removes > any files not in that list (permissions permitting). Run it from cron. > Requires Python 2.3 or later. Don't cut yourself. > > Regards, > Cliff > > > > ------------------------------------------------------------------------ > > _______________________________________________ > PDXLUG mailing list > [email protected] > http://pdxlug.org/mailman/listinfo/pdxlug Thanks a lot. I'll give that a shot. It sounds much cleaner than my PHP solution. passthru("rm -Rdfv /home/chris/tmp/urchin/data"); But after the response I got from my host, I'm not really concerned too much with the cleanliness, unless it'd affect my site directly. So far the only problem I've noticed is not being able to access Urchin which, since I didn't use it anyway, isn't really a problem. Chris