1834508 Members
2479 Online
110068 Solutions
New Discussion

/var/tmp 100%

 
Philip J. Priest_1
Frequent Advisor

/var/tmp 100%

There a way to limit users from filling up /var/tmp? Sometimes a process doesnt remove a tmp file from /var/tmp.
4 REPLIES 4
Sanjay_6
Honored Contributor

Re: /var/tmp 100%

Hi Philip,

You can have a cron job than can clean /var/tmp on a regular basis. Another choice is to redirect your user tmp files to another directory using the "TMPDIR" variable and then setting a quota on the directory size/growth. This willl restrict the user to the amount of space allocated by quota.

Maybe some other forum member has a better suggestion.

Hope this helps.

Regds
harry d brown jr
Honored Contributor

Re: /var/tmp 100%

Philip, you could remove your users, then they wouldn't be able to fill up /var/tmp. As Sanjay said, you should put a cron in place to clean up the directory. Another good thing to do, is make /var/tmp it's own mount point, so that other processes that might write to /var/whatever won't be hammered by some process filling up /var/tmp.

You could use quota's as Sanjay mentioned, but with that you will face performance overhead, and the possibility of hammering a real production process.

If you can identify the processes (users) that are doing this nasty deed, then have a discussion with them about "housekeeping".

live free or die
harry
Live Free or Die
A. Clay Stephenson
Acclaimed Contributor

Re: /var/tmp 100%

Hi:

There is no really good answer to this because it is considered the job of the programmer/script writer to be aware of available resources. Aside from regular cleanup scripts the best answer is to have a daemon which monitors all filesystems and then either sends messages via mail or better yet to a tool like IT/O or VP/O. Just to be fair, sometimes it's not the fault of the idiot programmer but rather the fault of the idiot admin who killed processes via kill -9 so that the temp files could not be removed.

If it ain't broke, I can fix that.
Tom Dawson
Regular Advisor

Re: /var/tmp 100%

Philip,

I created the attached script and config file to make this task a little easier. When I find a user process that doesn't cleanup well after itself, I make an entry in the "autocleanuup.conf" file. I run the autocleanup.sh script once per week.

Tom