Operating System - Linux
1827990 Members
2638 Online
109973 Solutions
New Discussion

Automatic renaming of core dump file

 
SOLVED
Go to solution
dscao
Advisor

Automatic renaming of core dump file

Is it possible on HP-UX to automatically rename the core file of an app coredump? So that successive coredumps get saved on the system, rather than that only the last one is retained.
7 REPLIES 7
Pete Randall
Outstanding Contributor

Re: Automatic renaming of core dump file

You could set up a cron job that would do a find, searching on the name core and then renaming it to core.`date` or something like that.


Pete

Pete
James R. Ferguson
Acclaimed Contributor
Solution

Re: Automatic renaming of core dump file

Hi:

If you want to name a corefile uniquely you can append the process id (pid) thusly (by setting the 'core_pid' kernel variable:

For 11.00 or 11.11:

# echo 'core_addpid/W 1' | adb -k -w /stand/vmunix /dev/kmem

For 11.23:

# echo 'core_addpid/W 1' | adb -o -w /stand/vmunix /dev/kmem

Regards!

...JRF...
Sandman!
Honored Contributor

Re: Automatic renaming of core dump file

Rename the core file so it is unique and see if this does the trick for you:

# mv core core__$$

the $$ makes the filename unique as it's the pid of the subshell in which the command is executed.
dscao
Advisor

Re: Automatic renaming of core dump file

Thanks to all.
Dennis Handly
Acclaimed Contributor

Re: Automatic renaming of core dump file

>JRF: (by setting the 'core_pid' kernel variable:

11.31 has a coreadm command so you don't need to use adb.
James R. Ferguson
Acclaimed Contributor

Re: Automatic renaming of core dump file

Hi Dennis:

Thanks for the 11.31 info. From some cursory reading and tidbits like those you have provided, I would say 11iv3 has some really NICE features.

Regards!

...JRF...
Dennis Handly
Acclaimed Contributor

Re: Automatic renaming of core dump file

>JRF: Thanks for the 11.31 info. From some cursory reading and tidbits like those you have provided, I would say 11iv3 has some really NICE features.

You can look at all of the 11.31 documentation:
http://docs.hp.com/en/oshpux11iv3.html#Release%20Notes

And Chapter 3 has what's new:
http://docs.hp.com/en/5991-6469/ch03.html