Ask Your Question

Clean Temp files

asked 2011-11-11 02:10:28 -0500

Cody gravatar image

How can I set temp files to be removed at boot Fedora 12

edit retag flag offensive close merge delete

4 Answers

Sort by ยป oldest newest most voted

answered 2011-11-11 04:32:38 -0500

Rajat gravatar image

find . -type f -mtime +10` -exec rm {} \;

Above command remove only 10day old file you give try out.

edit flag offensive delete link more


I really like this one, read on tpmwatch but it doesn't do anything find + rm as in this example can't do.

tezcatl gravatar imagetezcatl ( 2013-07-05 06:20:22 -0500 )edit

answered 2011-11-11 02:28:38 -0500

lzap gravatar image

I do not recommend it, but you can put

rm -rf /tmp/*

to your

edit flag offensive delete link more


This one combined with the solution proposed by Rajat would be a nice one. However, beyond F12 is pretty old, would you like to elaborate a bit on why don't you recommend this approach?

tezcatl gravatar imagetezcatl ( 2013-07-05 06:22:25 -0500 )edit

answered 2011-11-11 04:26:15 -0500

B gravatar image

Yeah its not recomanded and maybe you should use tmpwatch to do it ( and delete only oldies :-)

But first question is : why do you want to remove all the temporary files ? Just to save space (Did you tried to look at cache files too ) ?

Ex : yum store his cache at /var/cache/yum and this cache can be sometime huge ...

edit flag offensive delete link more

answered 2011-11-11 08:30:54 -0500

chrislaz gravatar image

Instead of deleting temp files, if you have enough RAM you can put the whole directory in the memory. It's much faster and there is no need to delete anything as they go away any time you reboot ;)

Just add the following line in your /etc/fstab:

tmpfs /tmp tmpfs defaults,noatime,mode=1777,size=1000M 0 0

edit flag offensive delete link more


This is the way fedora is configured out of the box at this moment, however "enough RAM" is not an useful parameter and actually is giving a lot of trouble.

tezcatl gravatar imagetezcatl ( 2013-07-05 06:15:58 -0500 )edit

Question Tools

1 follower


Asked: 2011-11-11 02:10:28 -0500

Seen: 8,153 times

Last updated: Nov 11 '11