Handy Script to Clean Up Corefiles.

Handy Script to Clean Up Corefiles.

Create a file called rmcores(the author calls it handle-cores) with the following in it:

#!/bin/sh
USAGE=”$0 ”

if [ $# != 2 ] ; then
echo $USAGE
exit
fi

echo Deleting…
find $1 -name core -atime 7 -print -type f -exec rm {} \;

echo e-mailing
for name in `find $1 -name core -exec ls -l {} \; | cut -c16-24`
do
echo $name
cat $2 | mail $name
done

And have a cron job run it every so often.

Comments

comments

Powered by Facebook Comments

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Content Protected Using Blog Protector By: PcDrome. & GeekyCube.