[WBEL-users] tmpwatch command

Kirby C. Bohling kbohling@birddog.com
Wed, 15 Sep 2004 13:38:53 -0500


On Wed, Sep 15, 2004 at 07:23:15PM +0100, Graham Purcocks wrote:
> If this uses RAM you are seriously in trouble of running out of memory 
> if you write a lot to /tmp. I believe tmpfs was suggested for /var/run 
> not /tmp. So be careful.
> 

	Read the link, there is an easy way to limit how much VM space
you allow it to use.  As long as you increase the amount of swap
that is backed by disk, this is a non-issue.  The VM will start
flushing things to disk if there is memory pressure.  You just have
to make sure you have enough disk to cover it.  When you reboot the
files are gone.  It's a much better use of disk space, and of
memory.

	I learned this the hard way, because Mozilla in it's infinite
wisdom refuses to save files where I requested they be put (when
downloading three ISO images, it's easy to run out of /tmp space,
1.5GB seems excessive for tmp).  Mozilla always saves absolutely
everything to /tmp, and them copies it to where you want it, and
then removes the original.  Which is most irritating, I've learned
to love wget for any files of any size, it also means I don't end up
having three times the disk traffic I should have had.

	If you dedicate several gigabytes of disk to swap and none to
tmp, this is no big deal.  It's a more efficient way of dealing with
tmp files in the long run.  If it didn't cause goofy issues with
specific applications I do run, I'd do it on all my machines.

Thanks,
	Kirby


> Kirby C. Bohling wrote:
> 
> >On Wed, Sep 15, 2004 at 11:35:17AM -0600, Jason Becker wrote:
> >
> >>Hi All,
> >>
> >>My servers don't get rebooted very often but when they do I'd like /tmp 
> >>to be cleared out. I really like the *BSD clear_tmp_enable (in rc.conf) 
> >>method for doing this. Linux has tmpwatch. Would someone care to share 
> >>there command line for a cron job?
> >
> >
> >/etc/cron.daily/tmpwatch
> >
> >It's a standard part of most recent RedHat releases.
> >
> >If you really want to have it cleared, use tmpfs instead of a real
> >filesystem (it'd be more real "UNIX" like from what I'm told).  I
> >know someone just today replied with how well it works on the list.
> >
> >There is where I first read about it, it's written by the guy who
> >started Gentoo:
> >http://www-106.ibm.com/developerworks/library/l-fs3.html
> >
> >However, I'm told that tmpfs has caused weird problems in the past
> >on several lists I'm on.  Essentially, using readdir while files are
> >being added or removed might not work the way a standard filesystem
> >does (the list isn't stable, so if a file "A" is removed, file "B"
> >might show up via readdir twice, once before "A" was removed, and
> >once after "A" was removed).  I'm not sure that it still exists, but
> >I know that it caused problems for both BitKeeper and for
> >Subversion.
> >
> >	Don't ask, I don't get it.  I know that lots of people do this,
> >but every once in a while it'll cause problems with applications.
> >My personal best "/tmp", is that if /tmp is a softlink, on some
> >versions of Linux Kernel/glibc you won't be able to change your
> >crontab entry using vim as your editor.  There's some kind of race
> >condition.  I've learned it's just best to just use a standard
> >filesystem for it, and have a dedicate partition for it.
> >
> >	Kirby
> >
> >
> >>TIA
> >>
> >>Cheers
> >>
> >>-- 
> >>Jason Becker
> >>Director & CEO
> >>Coalescent Systems Inc.
> >>403.244.8089
> >>www.voxbox.ca
> >>
> >>_______________________________________________
> >>Whitebox-users mailing list
> >>Whitebox-users@beau.org
> >>http://beau.org/mailman/listinfo/whitebox-users
> >>
> >
> >_______________________________________________
> >Whitebox-users mailing list
> >Whitebox-users@beau.org
> >http://beau.org/mailman/listinfo/whitebox-users