Discussion:
is it save to clean /var/tmp?
(too old to reply)
William Ballard
2004-06-27 07:40:07 UTC
Permalink
/tmp seems to clean itself up on reboots; but /var/tmp contains a
vi.recover which I think is making me receive annoying mails about how I
can recover my files every time I reboot.

I'm going to delete /var/tmp/vi.recover, but is it safe to delete
everything else in /var/tmp after a reboot?

Here's what's in mine:

$ ls /var/tmp/
kdecache-tom logcheck.XXfx4Uek logcheck.XXOYfWra
[lots more logcheck files]
logcheck.XXeC5E6e logcheck.XXlRgLlQ logcheck.XXZYiE78
logcheck.XXeTThfb logcheck.XXnvFoSm vi.recover
logcheck.XXfmlIaF logcheck.XXNwJtkV
--
To UNSUBSCRIBE, email to debian-user-***@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@lists.debian.org
Andreas Janssen
2004-06-27 08:10:08 UTC
Permalink
Hello
Post by William Ballard
/tmp seems to clean itself up on reboots; but /var/tmp contains a
vi.recover which I think is making me receive annoying mails about how
I can recover my files every time I reboot.
I'm going to delete /var/tmp/vi.recover, but is it safe to delete
everything else in /var/tmp after a reboot?
Basically: no. it is not safe. From the File Hierarchy Standard (2.3):

|/var/tmp : Temporary files preserved between system reboots
|
|Purpose
|
|The /var/tmp directory is made available for programs that
|requiretemporary files or directories that are preserved between system
|reboots. Therefore, data stored in /var/tmp is more persistent than
|data in /tmp.


|Files and directories located in /var/tmp must not be deleted when the
|system is booted. Although data stored in /var/tmp is typically deleted
|in a site-specific manner, it is recommended that deletions occur at a
|less frequent interval than /tmp.

You can of course delete the files from time to time, but probably some
apps expect their files to still be there after reboot.

best regards
Andreas Janssen
--
Andreas Janssen <***@bigfoot.com>
PGP-Key-ID: 0xDC801674 ICQ #17079270
Registered Linux User #267976
http://www.andreas-janssen.de/debian-tipps.html
--
To UNSUBSCRIBE, email to debian-user-***@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@lists.debian.org
William Ballard
2004-06-27 08:30:10 UTC
Permalink
Post by Andreas Janssen
You can of course delete the files from time to time, but probably some
apps expect their files to still be there after reboot.
It seems pretty obvious that it's safe to delete something called
"kdecache". But how about all those logcheck.* files I had? It's too
late; I already blew them away. It must be safe; after all, logcheck
works on freshly installed system.

But you say you must make these decisions on a case by case basis.
--
To UNSUBSCRIBE, email to debian-user-***@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@lists.debian.org
Jean-François Lemaire
2004-06-27 14:00:11 UTC
Permalink
Hello,
Post by William Ballard
Post by Andreas Janssen
You can of course delete the files from time to time, but probably
some apps expect their files to still be there after reboot.
It seems pretty obvious that it's safe to delete something called
"kdecache".
"/var/tmp/kdecache-" contains, among other things, Konqueror's favicons.
If you use Konqueror and like the favicons, you shouldn't delete that
folder, since you'll lose all those nifty icons.


JFL
--
To UNSUBSCRIBE, email to debian-user-***@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@lists.debian.org
Adam Funk
2004-06-27 12:00:14 UTC
Permalink
Post by Andreas Janssen
|/var/tmp : Temporary files preserved between system reboots
|
|Purpose
|
|The /var/tmp directory is made available for programs that
|requiretemporary files or directories that are preserved between
|system reboots. Therefore, data stored in /var/tmp is more persistent
|than data in /tmp.
|Files and directories located in /var/tmp must not be deleted when
|the system is booted. Although data stored in /var/tmp is typically
|deleted in a site-specific manner, it is recommended that deletions
|occur at a less frequent interval than /tmp.
You can of course delete the files from time to time, but probably
some apps expect their files to still be there after reboot.
Does that mean it's OK to clean out /tmp regularly?
--
To UNSUBSCRIBE, email to debian-user-***@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@lists.debian.org
Andreas Janssen
2004-06-27 13:30:16 UTC
Permalink
Hello
Post by Adam Funk
Does that mean it's OK to clean out /tmp regularly?
What does regularly mean? It should work it /tmp is cleaned on reboot
(default on Woody). According to the FHS, applications must not except
files to be preserved after a reboot. However you should be careful if
you clean /tmp on a running system. Only removing files that haven't
been opened for a certain time should be safe, but I use Debian on a
desktop that is shut down at night, so I never bothered to set this up.

best regards
Andreas Janssen
--
Andreas Janssen <***@bigfoot.com>
PGP-Key-ID: 0xDC801674 ICQ #17079270
Registered Linux User #267976
http://www.andreas-janssen.de/debian-tipps.html
--
To UNSUBSCRIBE, email to debian-user-***@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@lists.debian.org
Bob Proulx
2004-06-28 05:00:08 UTC
Permalink
Post by Andreas Janssen
Post by William Ballard
/tmp seems to clean itself up on reboots; but /var/tmp contains a
vi.recover which I think is making me receive annoying mails about how
I can recover my files every time I reboot.
Probably the expectation is that you would recover those files from vi
and discard them if you don't want them. Try 'nvi -r'.
Post by Andreas Janssen
Post by William Ballard
I'm going to delete /var/tmp/vi.recover, but is it safe to delete
everything else in /var/tmp after a reboot?
I am going to disagree with my esteemed colleague and say yes, with
restrictions. Are you the only person using your computer? If so
then you can only hurt yourself. If the answer is that this is a
multiuser machine, say a university or large corporate business
machine, then no. You might be killing off someone else's work. But
if it is your own machine then fine.
Post by Andreas Janssen
|/var/tmp : Temporary files preserved between system reboots
|
|Purpose
|
|The /var/tmp directory is made available for programs that
|requiretemporary files or directories that are preserved between system
|reboots. Therefore, data stored in /var/tmp is more persistent than
|data in /tmp.
Those FHS rules apply to the system. And I agree with them. But the
administrator of the machine is allowed to set local policies which
override the FHS. See "site-specific manner" below.
Post by Andreas Janssen
|Files and directories located in /var/tmp must not be deleted when the
|system is booted. Although data stored in /var/tmp is typically deleted
|in a site-specific manner, it is recommended that deletions occur at a
|less frequent interval than /tmp.
You can of course delete the files from time to time, but probably some
apps expect their files to still be there after reboot.
One example is the one which started this. 'nvi' is one which expects
/var/tmp/vi.recover to be persistent across a reboot.

But a reasonable site-specific policy could be to delete files older
than a week. The 'tmpreaper' package provides this for Debian. It is
a fork of the Red hat 'tmpwatcher' package.

apt-cache show tmpreaper
apt-get install tmpreaper

Then modify /etc/tmpreaper.conf for something like the following. Use
your own site-specific policy here.

TMPREAPER_TIME=7d
TMPREAPER_DIRS='/tmp/. /var/tmp/.'

Bob

Loading...