The How-To Geek Forums Have Migrated to Discourse


How-To Geek Forums / Geek Stuff

Linux - Script To Clean Up Corefiles

(1 post)
  • Started 8 years ago by Zig
  • Topic Viewed 1814 times

PARTNER SPOTLIGHT

Recommended: Clean Your Mac the Easy Way with CleanMyMac 3

If you want to clean up your Mac the easy way, CleanMyMac is a great tool to get the job done easily, and it will even keep your computer clean automatically.

Unlike the competition, it also includes great tools like a Clean Uninstaller, to get rid of applications and clean up the junk that they leave behind. All with the click of a button.

Download CleanMyMac 3 for Free Today

Posted yesterday 
Top
Zig
Posts: 140

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.

Posted 8 years ago
Top
 



Topic Closed

This topic has been closed to new replies.