/tmp full; how and when is it cleaned?

Discussions Regarding Software

Moderator: Moderators

Post Reply
Growing Hen
Posts: 113
Joined: Sat Nov 03, 2012 8:53

/tmp full; how and when is it cleaned?

Post by Douglas_E_Knapp » Wed May 28, 2014 6:34

When does /tmp get cleared? My wife lost a 1/2 days work because libreoffice did not save properly when it said it did due to tmp being full. I don't like watching my wife cry and try and tell me Linux sucks and that I must by an Apple computer! Dropbox filled up the whole 100G. I removed all the Dropbox files and everything is back to normal and I must say running WAY faster than the system has in months.

So is there a script or something that removes files every night or on boot or something? I don't often reboot, mostly the computer "sleeps" at night.


PS is there a great program to monitor the drivers and prevent this over full problem for all the drives?

User avatar
Old Dear Hen
Posts: 873
Joined: Thu Sep 20, 2012 19:47
Location: Germany

Re: /tmp full; how and when is it cleaned?

Post by linuxfluesterer » Wed May 28, 2014 10:34

Exactly, my /tmp (and other temporary directories) I have put into a ramdisk, so all data is gone, when I shutdown.
I've added extra lines in my /etc/fstab, see here:

Code: Select all

devtmpfs                /dev                    devtmpfs gid=5,mode=620  0 0
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
tmpfs                   /run                    tmpfs   defaults        0 0
tmpfs                   /tmp                    tmpfs   rw,mode=1777    0 0
tmpfs                   /var/spool              tmpfs   rw,mode=1777    0 0 
tmpfs                   /var/tmp                tmpfs   rw,mode=1777    0 0
You may consider to do same... I have experienced no problem. Also every time, when boot up, the /dev, the /proc, the /run, the /sys directories are newly created by system anyway.

Due to that you won't reboot often, you may read this?
http://askubuntu.com/questions/20783/ho ... cleaned-up

I know, it's to OpenRC, but maybe the mentioned 'tmpreaper' utility can do the trick for you. It is in Sabayon repo.

-Linuxfluesterer (I love KDE ...)
Take away Facebook from me and let there be real people again...

Technological Hen
Posts: 305
Joined: Sat Nov 17, 2007 15:37

Re: /tmp full; how and when is it cleaned?

Post by anomaly65 » Mon Jun 09, 2014 18:00

I kept running into out of space (after weeks of uptime) junk in /tmp, so I changed the /etc/fstab entry "size" for /tmp like so. You may find simply doubling it from the default install of 100M might do just fine, but I've got more ram than needed, so no issues there :D

Code: Select all

 tmpfs                   /tmp                    tmpfs   noexec,nosuid,nodev,size=800M 0 0  
If size option is not mentioned, it'll easily "allow" up to 1/2 the memory to be used, but it does not allocate additional memory until necessary. I also create an additional similar cache directory for my web browser too, which speeds it up a bit, and upon reboot, all is forgiven/forgotten 8)

Use handrails on stairs. A nasty fall face first changes your point of view quickly, and mine permanently :-)

Technological Hen
Posts: 417
Joined: Thu Jan 11, 2007 0:24
Location: Sibiu, Romania

Re: /tmp full; how and when is it cleaned?

Post by totedati » Sat Aug 02, 2014 14:12

using your precious ram space for temporary files, when you wonder how you managed to fill all disk with temporary files is not a good solution!

is you /tmp dir in a separate partition? if not yet why not? is a simple solution, make a separate small partition
5G i think is enough even for dvd images preparations

disk space is cheap, ram space is precious and from my point of view is insane this modern trend to push all things in ram ( i mean things like Using zram for memory compression on Gentoo )

also utilities like

Code: Select all

equo search app-admin/tmpreaper
╠  @@ Searching...
╠      @@ Package: app-admin/tmpreaper-1.6.13 branch: 5, [sabayon-weekly] 
╠          Available:     version: 1.6.13 ~ tag: NoTag ~ revision: 0
╠          Installed:     version: Not installed ~ tag: n/a ~ revision: n/a
╠          Slot:          0
╠          Homepage:      http://packages.debian.org/sid/tmpreaper 
╠          Description:   A utility for removing files based 
╠                         on when they were last accessed 
╠          License:       GPL-2
╠   Keywords:  app-admin/tmpreaper
╠   Found:     1 entry

Code: Select all

equo search app-admin/tmpwatch
╠  @@ Searching...
╠      @@ Package: app-admin/tmpwatch-2.11-r1 branch: 5, [sabayon-weekly] 
╠          Available:     version: 2.11-r1 ~ tag: NoTag ~ revision: 0
╠          Installed:     version: Not installed ~ tag: n/a ~ revision: n/a
╠          Slot:          0
╠          Homepage:      https://fedorahosted.org/tmpwatch/ 
╠          Description:   Files which haven't been accessed 
╠                         in a given period of time are removed 
╠                         from specified directories 
╠          License:       GPL-2
╠   Keywords:  app-admin/tmpwatch
╠   Found:     1 entry
can help but i do not used any ... not needed yet, /tmp separate partition was enough for me to keep away of any surprise even with long uptimes, months for me, and normal desktop usage

but for a wife can help more than an

Code: Select all

df -h
command in console!
linux is free, the expertise to harness it is not!
you don't make so much money selling open source software!
You make MORE money USING it, just like google!
linux registered user #352479

Simple Hen
Posts: 45
Joined: Fri Jun 28, 2013 13:36

Re: /tmp full; how and when is it cleaned?

Post by shade304 » Thu Nov 06, 2014 4:58


Dropbox gave me fits too, I still somewhat think systemd is to blame, but no proof, but never had a problem before the change..

User avatar
Sagely Hen
Posts: 3561
Joined: Sun Sep 21, 2008 1:12
Location: Italy

Re: /tmp full; how and when is it cleaned?

Post by sabayonino » Sat Jan 09, 2016 12:30

anyway ... /tmp is wiped every reboot/boot system

you can change tmp dir in LO preferences

Post Reply