1834885 Members
2479 Online
110071 Solutions
New Discussion

core file

 
Arthur_3
Regular Advisor

core file

Is it possible to change the location for when a core file is generated, it is usally in / but this directory is not large enough to cope with it. If a hard link from a created file called core in / was used would this work or does the system just generate a new core and not log to the created one.


TIA
6 REPLIES 6
Sridhar Bhaskarla
Honored Contributor

Re: core file

Hi Arthur,

The location is dependent on the process that generates the core. So, it is not a hard and fast rule that the core is always in /. Your solutions works if you don't want any core to stay in /.

You can do like this

#ln -s /file_system/core /core

-Sri

You may be disappointed if you fail, but you are doomed if you don't try
Tom Geudens
Honored Contributor

Re: core file

Hi,
In most scripts (those you "submit" from crontab for example) you can simply do this
by putting an cd /to_directory_where_you_want
in front of the "essential" command ...
For example
#!/usr/bin/sh
cd /opt/tivoli
/opt/tivoli/tsm/client/ba/bin/dsmc ...

A coredump from dsmc would then be in /opt/tivoli ...

Regards,
Tom Geudens
A life ? Cool ! Where can I download one of those from ?
Uday_S_Ankolekar
Honored Contributor

Re: core file

Hi ,

Identify the directory where core file normaly genarates and then have a symbolic link to that perticular directory
This way no corefiles left around hogging disk space.

eg. ln -s /coredirectory /tmp/core

Also if you want to limit the size of the core use ulimit

In .profile file add ulimit -c 0
This works for posix shell

Goodluck,
-USA..
Good Luck..
Eugen Cocalea
Respected Contributor

Re: core file

Hi,

If you don't need the 'core' file, why don't you just

ulimit -c 0

which will set the limit size of the core file to 0 -> it won't take any disk space ;)

ulimit -a

will show you the current settings.

E.
To Live Is To Learn
Arthur_3
Regular Advisor

Re: core file

Hello,


Thanks for the info to all...

Uday, if th core file is generated in / surelly I cant just to a link from /?? Sorry, my HP-UX knowledge is very limited:-)

TIA
Darrell Allen
Honored Contributor

Re: core file

Hi Arthur,

As others have indicated, you are nearly right concerning the link. A hard link won't work because it must be in the same filesystem. Use a symbolic (soft) link to get around that.

As info, core files are re-used. That is to say, the inode number is not changed when a process overwrites a core file. That is true of the regular file "core" whether it is referenced by a symlink or not.

You are also correct that you can't have / as a symlink. However, you can have /core as a symlink.

If uncertain what process is creating the core file, do what core.

Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)