Operating System - Linux
1753893 Members
7503 Online
108809 Solutions
New Discussion юеВ

Re: script to find core and crash files in a machine

 
Narendra Thapa
Frequent Advisor

script to find core and crash files in a machine

I need a script to find core and crash file in different nodes. Eg. I have setup of four nodes and I want to see from the 5th node that whether core and crash files are creating in machines or not.
So I want to run this script from 5th node to verify this. Therefore I need this script to find core and crash files in other nodes.
"Study as if you were going to live forever; live as if you were going to die tomorrow."
4 REPLIES 4
Piergiacomo Perini
Trusted Contributor

Re: script to find core and crash files in a machine

Hi Narendra and welcome to ITRC Forums.

You can base your script on these two commands:
cd /
find . -type f -name "core"

hth
best regards
pg

And as Peter Godron says

Please also read:
http://forums1.itrc.hp.com/service/forums/helptips.do?#33
on how to reward any useful answers given to your questions.
Dennis Handly
Acclaimed Contributor

Re: script to find core and crash files in a machine

If you are talking about system crashes, they would be in /var/adm/crash/. And in directories named crash.#.
Steven Schweda
Honored Contributor

Re: script to find core and crash files in a machine

As usual, the details depend on the details,
like exactly where you wish to look for the
"core" files (or whatever). The basic
command might look like:

find fs_list -xdev -name core -type f

where "fs_list" is a list of mount points for
the file systems (or directories) of
interest. For example, if /, /usr, and /var
are all separate file systems:

find / /usr /var -xdev -name core -type f

It's possible to do this on a remote system
using NFS, but it'd probably be much more
efficient to run the command remotely on the
system(s) of interest using rsh or ssh.

You could also write a shell script which
collected the output from the "find" command,
and e-mailed the stuff to someone who cared.
You could use "cron" to automate the job on
each system, and have it run early every
morning, so you'd get the daily "core/crash"
report bright and early every day.

Many things are possible.
Arturo Galbiati
Esteemed Contributor

Re: script to find core and crash files in a machine

Hi,
to find the core and to understand what are:

find / -name core -type f -exec echo "\n" \; -exec file {} \; -exec what {} \;

HTH,
Art