[lkml]   [1998]   [Oct]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Directory name problem...
25-Oct-98 17:00 you wrote:
> Hi Joe.

>> 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.

> Just as a point of interest, I'd suspect the following line (which is
> the version used here) would kill that email as well...

Q>> 30 4 * * * find / -name core -type f -exec rm {} ';'

> It runs slightly earlier than yours, but otherwise differs little...

>> You may want to speak to your sys-admin and see if this would be a
>> viable option. Good luck.

> Already tried, and he's not interested, but I did find out what script
> he's using...

Q>> #!/bin/sh
Q>> XYZZY="`find / -name core`"
Q>> for LOOP in `find $XYZZY | sort -ru` ; do
Q>> rm -fr $LOOP
Q>> done

> Apparently, the version I use (and show above) is "too simple to do
> the job"...and the version he uses was written for him by his son,
> who's doing Comp Sci on Solaris as school - aged 14 !!!

> Best wishes from Riley.

Hm. Great script. And what is current directory when script is running ? Not /
by any chances ? Then
-- cut --
mkdir /tmp/' dev '
touch /tmp/' dev '/core
-- cut --
will do the trick: /dev will be vanished, comp will be frozen and after
recovering (you'll need boot disk and such to do recovering :-) your %$%&#$#$%
friend will be aware that his son is not god in shell-scripting... Of course
you could use ' home ' or ' usr ' (this will create A LOT OF destruction :-)
but IMO ' dev ' is more then enough...

P.S. May be you could create better trick to learn you syadmin to not use this
script but this is completely unrelated to kernel problem anyway...

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

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