LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
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 06-24-2005, 01:46 AM   #1
puishor
Member
 
Registered: Jun 2005
Location: Bucharest
Distribution: Debian,Knoppix,Slackware
Posts: 91

Rep: Reputation: 15
/var/ and /tmp/ directories


Hi!

My as far as I know /var/ directory stores variable size data , and /tmp/ directorie store temporary files.
Does this imply that if I delete the contents of both of this dirs , my system is going to function ok for now on ?
i.e deletion of /tmp/ and /var/directory contents does hurt the system ?
I thought it was better to ask before proceed
 
Old 06-24-2005, 02:06 AM   #2
juanbobo
Member
 
Registered: Mar 2005
Location: Chicago
Distribution: Gentoo AMD64
Posts: 365

Rep: Reputation: 30
That would cause many programs not to work. /tmp is the temporary directory and /var is used to store log files, printer spools, and cache files which many programs access.
 
Old 06-24-2005, 02:22 AM   #3
puishor
Member
 
Registered: Jun 2005
Location: Bucharest
Distribution: Debian,Knoppix,Slackware
Posts: 91

Original Poster
Rep: Reputation: 15
Quote:
That would cause many programs not to work. /tmp is the temporary directory and /var is used to store log files, printer spools, and cache files which many programs access.
This would happen even if I delete thees directory files at the very startup ( manually , after system finished the startup process ) ?
 
Old 06-24-2005, 02:34 AM   #4
n0xvb
Member
 
Registered: Sep 2004
Location: 127.0.0.1
Distribution: Slackware 13; openSUSE 11.2
Posts: 255

Rep: Reputation: 32
Quote:
Originally posted by puishor
This would happen even if I delete thees directory files at the very startup ( manually , after system finished the startup process ) ?
Yes, there are files that many programs look for and will generate errors if they're not found.

If you're trying to save space, I would use the logrotate package and archive/delete the old log files.
 
Old 06-24-2005, 05:59 PM   #5
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 51
it's important to differentiate between /var
and
/var/tmp

might be able to erase the data in /tmp and /var/tmp
and contents will be regenerated
but to erase entire /var directory and you are screwed
 
Old 06-25-2005, 09:36 AM   #6
Boow
Member
 
Registered: Feb 2004
Distribution: Slackware 10.2
Posts: 669

Rep: Reputation: 32
If you just want to safly clean old tmp files left behind this script might be what your looking for. Just put this script in cron.daily

#!/bin/sh
find /tmp /var/tmp -not -type d -mtime +3 -print0 |xargs --null --no-run-if-empty rm -f

find /tmp /var/tmp -depth -mindepth 1 -type d -empty -print0 |xargs --null --no-run-if-empty rmdir
 
  


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
/var/tmp folder hardeep_ubhi Linux - General 4 10-02-2006 08:10 AM
kde, /tmp, /var/tmp and all that garba Linux - Software 4 06-17-2005 01:31 PM
/tmp /var/tmp Manuel-H Linux - General 3 04-23-2005 06:30 AM
Root directories /tmp, /var, /etc ninmonkeys Linux - General 7 11-21-2004 02:49 PM
Newbie question - /tmp /var/tmp Mr happy Linux - Security 3 01-27-2003 02:03 PM


All times are GMT -5. The time now is 02:40 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration