lkml.org 
[lkml]   [1998]   [Oct]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subject[Now offtopic] Re: Directory name problem...
On Sun, 25 Oct 1998, Joe wrote:
> I admin a machine, and do the same thing to wipe out cores every
> day. However, all i use is the following line in my root crontab:
>
> 0 6 * * * find / -name core -exec rm {} ';'
>
> Since this only wipes files, not directories, this leaves all my kernel
> stuff ok. every morning, my cron daemon sends me an e-mail that it
> couldn't wipe out 3 or 4 files with the name "core" in them, because they
> are in fact directories, and rm doesn't work. You may want to speak to
> your sys-admin and see if this would be a viable option. Good luck.

[I'm assuming we are talking about machines with multiple users]

That's much better than what the original adminstrator did, which can
only be described as being somewhere between idiocy and incompetence.
However, it still has problems:

1. It *tries* to remove directories, leading to spurious email. Fix
this with a "-type f" in the find arguments.

2. Core files are created for a reason. They may contain useful data
that someone might want to look at in a post mortem debugging session.
Such people will be annoyed if they find the files deleted. The usual
fix for this is to only nail core files that have not been accessed in
a while (say, a week). Try "+atime 7" in the find arguments.

3. If you allow users to mount removable media, such as floppy, zip,
or jaz, you probably don't want to delete core files on those. Fix
this by having separate crontab entries for each normally mounted
filesystem (e.g., "find /home ...") and using the "-xdev" argument
to tell each find to not cross filesystem boundaries.

--Tim Smith


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:45    [W:0.232 / U:0.160 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site