[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Cleaning Sarge's tmp directory



On Sun, 18 Sep 2005 14:37:09 +0200, Maurits van Rees wrote
(<[🔎] 20050918123708.GA1593@mauritsvanrees.xs4all.nl>):

> On Sun, Sep 18, 2005 at 07:11:15AM +1000, Felix Karpfen wrote:
>> I suspect that there is a missing cron routine and would welcome
>> the needed pointers in order to persuade the "tmp" directory to live
>> up to its name.
> 
> Try apt-get install tmpreaper.

My thanks to all three respondents for their advice.

Some of the advice added a little to my uncertainties.

"tmpreaper" was news and appears to do everything needed; and _more_!

,----
| Description:
| 
| Cleans up files in directories based on their age This package provides
| a program that can be used to clean out temporary-file directories.  It
| recursively searches the directory, refusing to chdir() across symlinks,
| and removes files that haven't been accessed in a user-specified amount
| of time.
| 
| 
`----

Assuming that I have got the correct syntax, I got the following in a
test-run:

,----
| [felixk@carrot felixk]$ tmpreaper --test 24h /tmp/
| (PID 32043) Pretending to clean up directory `/tmp/'.
| (PID 32044) Pretending to clean up directory `.X11-unix'.
| Not a regular file or directory `X64' -- skipping.
| (PID 32044) Back from recursing down `.X11-unix'.
| (PID 32044) Pretending to clean up directory `.ICE-unix'.
| Not a regular file or directory `2581' -- skipping.
| (PID 32044) Back from recursing down `.ICE-unix'.
| (PID 32044) Pretending to clean up directory `.font-unix'.
| Not a regular file or directory `fs7110' -- skipping.
| (PID 32044) Back from recursing down `.font-unix'.
| (PID 32044) Pretending to clean up directory `orbit-felixk'.
| Not a regular file or directory `linc-9c9-0-7a9ba17e3a8bb' -- skipping.
| Pretending to remove file `orbit-felixk/bonobo-activation-register.lock'.
| Not a regular file or directory `linc-9e5-0-1006e1133aa3f' -- skipping.
| 
| Remainder snipped
| -- 

In addition, a "tmpreaper" script has been added to /etc/cron.daily that
appears to protect /tmp files and directories that are not meant to be
removed. 

"anacron" is already installed.  But I hesitate to run any "rm" command
as "root" without knowing which files can safely be removed and which
should not be touched.

And the advice that the /tmp directory is cleaned at every reboot
helps to explain why it did not contain many more files; it fails to
explain why a lot of *.jpg files survived for over 8 months. 

As stated at the beginning, I am grateful for all the advice and
"tmpreaper" appears to solve my problem and protect me from my own
defective knowledge.

Felix Karpfen

-- 
Felix Karpfen
Public Key 72FDF9DF (DH/DSA)




Reply to: