Go Back   openSUSE Forums > New User How To/FAQ (read only) > Unreviewed How To and FAQ
Forums FAQ Members List Search Today's Posts Mark Forums Read


Unreviewed How To and FAQ POST HERE: Tips and solutions for SUSE Linux from the community. (Please do not post questions)

Reply
Page 1 of 2 1 2
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 14-Apr-2009, 23:19
caf4926's Avatar
Global Moderator
 
Join Date: Jun 2008
Location: The English Lake District. UK - GMT/BST
Posts: 12,931
caf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputation
Send a message via MSN to caf4926
Default Clear Temp Files at Boot

To Clear /tmp Files at Boot

Doing this will help prevent 'crud' from building up and taking up disc space. This guide to remove files from /tmp provides the basic requirement that should satisfy most users.

Open Yast /etc/sysconfig Editor


Navigate to System - Cron - Max_Days_In_Temp and set to 1


Next confirm the dir to clear is /tmp


Then to: Clear_Temp_Dirs_AT_Bootup and change to yes


Accept the changes.

/tmp will be cleared at re-boot.
__________________
Box: openSUSE 11.2 | (KDE4.3.3) | M2N4-SLI | AMD 64 X2 5200+ | nVidia 8500GT | 4GB RAM
Lap: openSUSE 11.2 | Celeron 550 | (KDE4.3.3)"3" | Intel 965 GM | Lenovo R61e | 3GB RAM
Reply With Quote
  #2 (permalink)  
Old 15-Apr-2009, 00:13
Wise Penguin
 
Join Date: Mar 2009
Posts: 1,824
Akoellh is a reputation jewel in the roughAkoellh is a reputation jewel in the roughAkoellh is a reputation jewel in the roughAkoellh is a reputation jewel in the roughAkoellh is a reputation jewel in the rough
Default Re: Clear Temp Files at Boot

Just a little comment.

If you choose to clear /tmp at bootup and /tmp is the only directory to be cleared, setting MAX_DAYS_IN_TEMP is rather useless or can be even dangerous if you only set it to 1 day.

If there are temporary files which are needed for a longer time (no, I don't have an example at the moment) which will be automatically cleared after 1 day and some application still wants to access that file later => problem.

Leaving the default value (5 days IIRC //Edit: actually it's 0 = don't clean automatically) is the safer way, still everything will be cleared up on next boot.
__________________
“Never attribute to malice that which can be adequately explained by stupidity.” (R.J. Hanlon)
Reply With Quote
  #3 (permalink)  
Old 15-Apr-2009, 07:29
Puzzled Penguin
 
Join Date: Jun 2008
Posts: 31
suezuh hasn't been rated much yet
Default Re: Clear Temp Files at Boot

Never had a problem doing this. I'm actually running /tmp in RAM so that it is fast, secure, and completely purged at shutdown. Nothing is stored onto HDD. In addition I lock down /tmp for additional security.

There are some interesting suggestions, including how to make /tmp a RAM-based filesystem, here: Hardening a Linux or OpenBSD Installation
Reply With Quote
  #4 (permalink)  
Old 15-Apr-2009, 08:16
Wise Penguin
 
Join Date: Jun 2008
Location: United Kingdom
Posts: 1,026
consused hasn't been rated much yet
Default Re: Clear Temp Files at Boot

suezuh thank you for that link. I will give the /tmp in RAM a try.
Cheers
Reply With Quote
  #5 (permalink)  
Old 15-Apr-2009, 21:45
Puzzled Penguin
 
Join Date: Jun 2008
Posts: 31
suezuh hasn't been rated much yet
Default Re: Clear Temp Files at Boot

You're welcome. Just for example, here's my fstab entry:
none /tmp tmpfs rw,noexec,nosuid,nodev,noatime,nodiratime,size=200 M 1 2

The max size of /tmp in my RAM is set at 200 megs. Set it to whatever you need. The actual size varies in RAM depending on system requirements.

Firefox cache is also set to run in /tmp, and therefore in RAM. I've set that to 50M.
Reply With Quote
  #6 (permalink)  
Old 16-Apr-2009, 01:52
Andy Sipowicz
Guest
 
Posts: n/a
Default Re: Clear Temp Files at Boot

> none /tmp tmpfs
> rw,noexec,nosuid,nodev,noatime,nodiratime,size=200 M 1 2


oh no! does a tmpfs automatically run in RAM?? i failed to note that.

to force /tmp clearing at boot, and following a long ago seen post, i
set my fstab to:

none /tmp tmpfs auto,nodev,noexec,noatime 0 0

*without* your size limits...how does it know how much RAM it can
use...or, can it FILL the RAM???

hmmmm, it has been running for months like that (rebooting after
overnight shutdown to conserve energy)...should/must i change to
caf4926's way???

--
Andy Sipowicz
Reply With Quote
  #7 (permalink)  
Old 16-Apr-2009, 02:10
Wise Penguin
 
Join Date: Mar 2009
Posts: 1,824
Akoellh is a reputation jewel in the roughAkoellh is a reputation jewel in the roughAkoellh is a reputation jewel in the roughAkoellh is a reputation jewel in the roughAkoellh is a reputation jewel in the rough
Default Re: Clear Temp Files at Boot

Quote:
Originally Posted by Andy Sipowicz View Post
*without* your size limits...how does it know how much RAM it can
use...or, can it FILL the RAM???
Read "man mount" (search for tmpfs if you don't want to read all of it).
__________________
“Never attribute to malice that which can be adequately explained by stupidity.” (R.J. Hanlon)
Reply With Quote
  #8 (permalink)  
Old 16-Apr-2009, 02:11
caf4926's Avatar
Global Moderator
 
Join Date: Jun 2008
Location: The English Lake District. UK - GMT/BST
Posts: 12,931
caf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputation
Send a message via MSN to caf4926
Default Re: Clear Temp Files at Boot

Some data is saved to /tmp
ie; say you copy a dvd and create image only. the .iso is stored in /tmp/kde-*username
With a default install that will stay there forever.

I'm not sure have using /tmp to RAM would be affected by a .iso like that?

I set mine to 1day
But it seems users have different ideas.
__________________
Box: openSUSE 11.2 | (KDE4.3.3) | M2N4-SLI | AMD 64 X2 5200+ | nVidia 8500GT | 4GB RAM
Lap: openSUSE 11.2 | Celeron 550 | (KDE4.3.3)"3" | Intel 965 GM | Lenovo R61e | 3GB RAM
Reply With Quote
  #9 (permalink)  
Old 16-Apr-2009, 08:32
Puzzled Penguin
 
Join Date: Jun 2008
Posts: 31
suezuh hasn't been rated much yet
Default Re: Clear Temp Files at Boot

does a tmpfs automatically run in RAM??

Yes.

*without* your size limits...how does it know how much RAM it can
use...or, can it FILL the RAM???

By default, it uses up to half.

hmmmm, it has been running for months like that (rebooting after
overnight shutdown to conserve energy)...should/must i change to
caf4926's way???

Do it any way you'd like.
Reply With Quote
  #10 (permalink)  
Old 17-Apr-2009, 10:57
Dexter1979's Avatar
Parent Penguin
 
Join Date: Jun 2008
Location: +52° 9' 13.68", -8° 37' 57.07"
Posts: 506
Dexter1979 's reputation will be famous soon enoughDexter1979 's reputation will be famous soon enoughDexter1979 's reputation will be famous soon enough
Default Re: Clear Temp Files at Boot

I set this up 2 days ago and so far I have no problems other than a slightly longer boot time due to the files being removed and more disc space

I had about 4 Gb of temporary files apparantly. Probably the last DVD I 'backed up' with K9copy.
__________________
Lord Flasheart: Always treat your plane like you treat your woman.
Lieutenant George: Take her home at the weekend to meet your mother?
Lord Flasheart: No, get inside her five times a day and take her to heaven and back!
Reply With Quote
Reply
Page 1 of 2 1 2

Bookmarks

Tags
/tmp directory, clear temp


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




 

Search Engine Friendly URLs by vBSEO 3.3.0 RC2