LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 05-31-2003, 08:28 PM   #1
Bobmeister
Member
 
Registered: May 2003
Location: Mt. Prospect, Illinois
Distribution: Fedora Core 2, SuSE 9.1 Professional
Posts: 189

Rep: Reputation: 30
/tmp directory


Hello.

I am still new to Linux and with a really stupid question, I think. I am aware that in my Red Hat 9 system CRON is being forced by ANACRON to run several maintenance functions and can read them in the crontab file with no problem. I also am aware that there is a program that runs now and then (maybe) called tmpwatch.

My question is about the /tmp directory. How safe is it to empty stuff out of there? I would only do it after a fresh reboot. There is one directory in there called /tmp/orbit/"my user account" that has a gagillion 0KB files. Now, I don't think I have a problem clearning that out now and then, but want to make sure first.

So the bottom line question is this, and I'm really sorry if others have been on the posts with the (I can't find it)...CAN I DELETE ALL OF THE STUFF IN THE /tmp DIRECTORY or should I just leave it alone?

Thanks
 
Old 05-31-2003, 08:41 PM   #2
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 197Reputation: 197
You can safely remove all files in /tmp

At times its best to remove them like you said after a fresh reboot or put a small script to clear out the directory in your startup scripts.
 
Old 06-01-2003, 02:51 AM   #3
markus1982
Senior Member
 
Registered: Aug 2002
Location: Stuttgart (Germany)
Distribution: Debian/GNU Linux
Posts: 1,467

Rep: Reputation: 46
I would rather say add a tmp cleanup script to your cron.daily. Like you could use:
Code:
#!/bin/sh

# clean up /tmp and /var/tmp

if [ -d /tmp -a -d /var/tmp ]
then
        find /tmp -type f -atime +3 -exec rm {} \;
        find /var/tmp -type f -atime +3 -exec rm {} \;
fi
This will remove files in /tmp and /var/tmp that haven't been accessed in 4 (3+1) days.
 
1 members found this post helpful.
Old 06-01-2003, 04:32 PM   #4
Bobmeister
Member
 
Registered: May 2003
Location: Mt. Prospect, Illinois
Distribution: Fedora Core 2, SuSE 9.1 Professional
Posts: 189

Original Poster
Rep: Reputation: 30
Thanks all...

I will take your advice....right now, I don't have a problem manually cleaning every now and then as I am interested in just kind of monitoring what goes on in there.

But I might run that script for later...or look at my CRONTAB to see what might be modified to get it to clean it more often. However, I'm not adverse to doing it manually.

I am having fun in Linux and leaned a lot today installing Java and doing some CD burning with CDroast...a pretty robust program if you ask me...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
/tmp directory is full? Moses420ca Linux - Newbie 13 01-21-2005 07:48 PM
tmp directory being deleted jpokrzyk Linux - General 3 10-30-2004 06:42 PM
Can I delete everything in the /tmp directory? BajaNick Linux - General 5 07-04-2004 01:35 PM
permissions in /tmp directory linux_pioneer Linux - Software 1 08-30-2003 10:43 PM
/tmp directory too small??? kazi Linux - Newbie 9 03-29-2003 12:46 PM


All times are GMT -5. The time now is 01:19 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration