You are not logged in.

#1 2010-10-21 15:28:44

Xi0N
Member
From: Bilbao - Spain
Registered: 2007-11-29
Posts: 832
Website

tmp folder cleanup

Hi all!
Suddenly, today, i was unable to open programs and the system looked really slow.... then, i realized that the root partition (containing /tmp) was full.

When i entered /tmp, i found thousands of folders with names starting by "bug-buddy-xxxxx"
I am trying to delete everything in /tmp to free the space up.
I need several things:

1) Is it safe to regularly wipe the /tmp folder?
2) Can i do it automatically?
3) How can i wipe everything under /tmp? if i try rm -R /tmp/* i get an error complaining about "too many arguments".....

Thanks!

Last edited by Xi0N (2010-10-21 15:29:54)

Offline

#2 2010-10-21 16:42:00

ChoK
Member
From: France
Registered: 2008-10-01
Posts: 346

Re: tmp folder cleanup

It's safe to clean it regularly (well when the programs aren't using it of course). Mine is mounted over tmpfs so at every shutdown it's emptied.

at every boot it's emptied by /etc/rc.sysinit with the following command
/bin/rm -rf /tmp/* /tmp/.* &>/dev/null

You can put that in a cron job and maybe check with lsof or fuser if the file is on use.


Ah, good taste! What a dreadful thing! Taste is the enemy of creativeness.
Picasso
Perfection is reached, not when there is no longer anything to add, but when there is no longer anything to take away.
Saint Exupéry

Offline

#3 2010-10-21 19:35:34

Xi0N
Member
From: Bilbao - Spain
Registered: 2007-11-29
Posts: 832
Website

Re: tmp folder cleanup

Thanks! I think i will just erase it manually from time to time....... meanwhile, i will have a look on that way you said: Mounting as tmpfs.....

Offline

#4 2010-10-21 20:17:14

stqn
Member
Registered: 2010-03-19
Posts: 1,191
Website

Re: tmp folder cleanup

You can try:

for i in /tmp/* ; do rm -r "$i" ; done

Last edited by stqn (2010-10-21 20:18:23)

Offline

#5 2010-10-21 20:24:19

Xi0N
Member
From: Bilbao - Spain
Registered: 2007-11-29
Posts: 832
Website

Re: tmp folder cleanup

stqn wrote:

You can try:

for i in /tmp/* ; do rm -r "$i" ; done

That's whaat i did.... thanks!!

Offline

#6 2010-10-21 23:27:18

ChoK
Member
From: France
Registered: 2008-10-01
Posts: 346

Re: tmp folder cleanup

Some infos about tmpfs here
http://wiki.archlinux.org/index.php/Ramdisk
I have this line in /etc/fstab
none /tmp tmpfs noatime,nosuid,nodev,noexec 0 0

also when I said

at every boot it's emptied by /etc/rc.sysinit with the following command
/bin/rm -rf /tmp/* /tmp/.* &>/dev/null

I meant, it's the default on every arch install, so everytime you reboot /tmp is cleaned. My wording was a bit confusing

Last edited by ChoK (2010-10-21 23:29:25)


Ah, good taste! What a dreadful thing! Taste is the enemy of creativeness.
Picasso
Perfection is reached, not when there is no longer anything to add, but when there is no longer anything to take away.
Saint Exupéry

Offline

#7 2018-04-12 06:56:17

arjunv
Member
Registered: 2018-04-12
Posts: 1

Re: tmp folder cleanup

ChoK wrote:

Some infos about tmpfs here
http://wiki.archlinux.org/index.php/Ramdisk
I have this line in /etc/fstab
none /tmp tmpfs noatime,nosuid,nodev,noexec 0 0

also when I said

at every boot it's emptied by /etc/rc.sysinit with the following command
/bin/rm -rf /tmp/* /tmp/.* &>/dev/null

I meant, it's the default on every arch install, so everytime you reboot /tmp is cleaned. My wording was a bit confusing

Is this really required?
https://wiki.archlinux.org/index.php/Ramdisk

Under systemd, /tmp is automatically mounted as a tmpfs even though no entry is specified in /etc/fstab.

Offline

#8 2018-04-12 07:27:04

seth
Member
Registered: 2012-09-03
Posts: 51,299

Re: tmp folder cleanup

Dude, you're replying to a thread from *2010* ...

Offline

#9 2018-04-12 08:34:25

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,743

Re: tmp folder cleanup

Indeed. Please pay attention to the dates.

https://wiki.archlinux.org/index.php/Co … bumping.22

Closing.

Last edited by V1del (2018-04-12 08:35:16)

Offline

Board footer

Powered by FluxBB