1835533 Members
2841 Online
110078 Solutions
New Discussion

post crash core removal

 
SOLVED
Go to solution
Cody Godines_1
Occasional Advisor

post crash core removal

Hi everyone,
I'm on an HP c240 visualize. I have a graphical application that crashes and the system creates a core file. I'd like to have it automatically removed. Is this possible?

-Cody
7 REPLIES 7
Pete Randall
Outstanding Contributor

Re: post crash core removal

Cody,

You can do this with a crontab entry like this:

00 02 * * * /usr/bin/find / -name "core" -mtime +2 -exec rm {} \;

This would remove any core files which are over 2 days old.

Pete

Pete
Ted Ellis_2
Honored Contributor

Re: post crash core removal

only one core file (or directory) can exist under any one part of the directory trees... we protect our / mount point by also creating a /core directory. This prevents any core file from being dropped at the top level /

Ted
Cody Godines_1
Occasional Advisor

Re: post crash core removal

Those are good ways to do it. But I think there is a feature that can be turned off or something. That is what I'm looking for.
-Cody
Ted Ellis_2
Honored Contributor

Re: post crash core removal

link with some good info and a way to prevent them, though in some cases you may want them to help analyze what is causing the problem

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x947a7d4cf554d611abdb0090277a778c,00.html
John Poff
Honored Contributor

Re: post crash core removal

Hi,

I think you can do a 'ulimit -c 0' in your profile which specifies the number of 512 byte blocks to use for core dumps, but that only works for the Posix shell. I don't think you can set it in ksh, and I don't know about other shell flavors (csh).

JP
Pete Randall
Outstanding Contributor
Solution

Re: post crash core removal

Cody,

Have a look at /etc/rc.config.d/savecrash. In particular check the SAVECRASH parameter:

# SAVECRASH: Set to 0 to disable saving system crash dumps.

Pete

Pete
Pete Randall
Outstanding Contributor

Re: post crash core removal

Sorry, Cody, I got interrupted in mid-thought there. You could mess with SAVECRASH, but in my opinion, you're better off to use my earlier "find" approach. It will keep them cleaned out but still allow you to examine one should you have a problem.

Pete

Pete