LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE
User Name
Password
SUSE / openSUSE This Forum is for the discussion of Suse Linux.

Notices


Reply
  Search this Thread
Old 03-29-2010, 07:56 AM   #1
Mr.Gosh
Member
 
Registered: Sep 2004
Location: Germany
Distribution: openSuSE 11.2 64 bit
Posts: 48

Rep: Reputation: 15
Question Delete Temp Folder on Shutdown?


Hey Guys,

I found this Example how to delete Temp files on shutdown automagically.

How can I achive this in opensuse 11.2?

Any Ideas?

Thx
 
Old 03-29-2010, 07:59 AM   #2
rizhun
Member
 
Registered: Jun 2005
Location: England
Distribution: Ubuntu, SLES, AIX
Posts: 268

Rep: Reputation: 47
Why not use:
Code:
/etc/init.d/halt.local
Just add:
Code:
rm -rf /tmp/*

Last edited by rizhun; 03-29-2010 at 08:01 AM.
 
1 members found this post helpful.
Old 03-29-2010, 08:06 AM   #3
Mr.Gosh
Member
 
Registered: Sep 2004
Location: Germany
Distribution: openSuSE 11.2 64 bit
Posts: 48

Original Poster
Rep: Reputation: 15
Smile

Quote:
Originally Posted by rizhun View Post
Why not use:
Code:
/etc/init.d/halt.local
Just add:
Code:
rm -rf /tmp/*
That was fast, just a secon ago I found that file and wanted to ask if its the right place to be?
Why has the ubuntu guy posted this Version of the delete Command?
Code:
rm -fr /tmp/* /tmp/.??*
are the dot Files not deleted in the other case?

Would anything speech against this script or shouldn`t that lead to problems?

Thanks again!
 
Old 03-29-2010, 08:18 AM   #4
rizhun
Member
 
Registered: Jun 2005
Location: England
Distribution: Ubuntu, SLES, AIX
Posts: 268

Rep: Reputation: 47
Yes, you'll need to use '/tmp/.??*' if you want to delete hidden files.

So you would put the following in /etc/init.d/halt.local:
Code:
rm -fr /tmp/* /tmp/.??*
Sorry, I don't understand this sentence, what do you mean by 'speech'?:
Quote:
Would anything speech against this script or shouldn`t that lead to problems?

Last edited by rizhun; 03-29-2010 at 08:20 AM.
 
Old 03-29-2010, 08:24 AM   #5
Mr.Gosh
Member
 
Registered: Sep 2004
Location: Germany
Distribution: openSuSE 11.2 64 bit
Posts: 48

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by rizhun View Post
Sorry, I don't understand this sentence, what do you mean by 'speech'?:
OK that is funny - I translated a german idiom into english without thinking about it...

I meant something like this:
"There is nothing to be said against it. Right?"

I wanted to know if it could be a problem to do that on shutdown?
 
Old 03-29-2010, 08:46 AM   #6
rizhun
Member
 
Registered: Jun 2005
Location: England
Distribution: Ubuntu, SLES, AIX
Posts: 268

Rep: Reputation: 47
I think it should be OK.

Nothing should be using /tmp that needs to be stored for an extended period of time.

You will lose your history files though, so you won't be able to look back at commands you've run in previous sessions. Although, this can be resolved by changing your $HISTFILE environment variable.
 
Old 03-29-2010, 08:33 PM   #7
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Look in Yast2`s sysconfig editor. Clearing /tmp on power down or for older files can be configured their.
 
  


Reply

Tags
temperature



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Delete temp files. caa1980 Ubuntu 6 03-29-2010 07:47 AM
delete temp file in linux Arjun123 Linux - Newbie 2 06-24-2009 12:18 AM
delete yesterday's temp files Flugelhornchris Programming 8 02-04-2008 12:52 PM
How To Delete temp Internet Files? agee220 Linux - Newbie 3 08-25-2004 02:36 PM
Temp Folder tfrye Linux - General 3 04-18-2001 08:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE

All times are GMT -5. The time now is 08:38 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration