<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: trying to write a ksh script to remove core files from / in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/trying-to-write-a-ksh-script-to-remove-core-files-from/m-p/5211925#M464996</link>
    <description>I should have been more specific.  &lt;BR /&gt;&lt;BR /&gt;I want to keep it to just the root directory not just the root file system.</description>
    <pubDate>Mon, 30 Nov 2009 20:04:54 GMT</pubDate>
    <dc:creator>PamelaJThrasher</dc:creator>
    <dc:date>2009-11-30T20:04:54Z</dc:date>
    <item>
      <title>trying to write a ksh script to remove core files from /</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/trying-to-write-a-ksh-script-to-remove-core-files-from/m-p/5211923#M464994</link>
      <description>Occasionally, my hpux 11.31 server drops a core file and fills up / which makes it impossible for me to get on to the server.  &lt;BR /&gt;&lt;BR /&gt;I would like to write a script to remove any core files in / (and only /) that would be executed automatically by our monitoring software when root fills up.&lt;BR /&gt;&lt;BR /&gt;I have been playing around with the find command but have not been sucessful in limiting that to searching only /. &lt;BR /&gt;&lt;BR /&gt;Any suggestions?&lt;BR /&gt;</description>
      <pubDate>Mon, 30 Nov 2009 19:56:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/trying-to-write-a-ksh-script-to-remove-core-files-from/m-p/5211923#M464994</guid>
      <dc:creator>PamelaJThrasher</dc:creator>
      <dc:date>2009-11-30T19:56:59Z</dc:date>
    </item>
    <item>
      <title>Re: trying to write a ksh script to remove core files from /</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/trying-to-write-a-ksh-script-to-remove-core-files-from/m-p/5211924#M464995</link>
      <description>Hi Pamela:&lt;BR /&gt;&lt;BR /&gt;If you truly want to limit your 'find' to the '/' filesystem you need to use '-xdev' which keeps 'find' from crossing mountpoints:&lt;BR /&gt;&lt;BR /&gt;# find / -xdev -type f -name core -exec rm {} +&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Mon, 30 Nov 2009 20:02:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/trying-to-write-a-ksh-script-to-remove-core-files-from/m-p/5211924#M464995</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-11-30T20:02:38Z</dc:date>
    </item>
    <item>
      <title>Re: trying to write a ksh script to remove core files from /</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/trying-to-write-a-ksh-script-to-remove-core-files-from/m-p/5211925#M464996</link>
      <description>I should have been more specific.  &lt;BR /&gt;&lt;BR /&gt;I want to keep it to just the root directory not just the root file system.</description>
      <pubDate>Mon, 30 Nov 2009 20:04:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/trying-to-write-a-ksh-script-to-remove-core-files-from/m-p/5211925#M464996</guid>
      <dc:creator>PamelaJThrasher</dc:creator>
      <dc:date>2009-11-30T20:04:54Z</dc:date>
    </item>
    <item>
      <title>Re: trying to write a ksh script to remove core files from /</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/trying-to-write-a-ksh-script-to-remove-core-files-from/m-p/5211926#M464997</link>
      <description>Hi (again) Pamela:&lt;BR /&gt;&lt;BR /&gt;Try this:&lt;BR /&gt;&lt;BR /&gt;# cd / &amp;amp;&amp;amp; find . -xdev -path "./*" -prune -name core -type f -exec ls -ld {} +&lt;BR /&gt;&lt;BR /&gt;If this is satisfactory, change the 'ls -ld' to 'rm'.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
      <pubDate>Mon, 30 Nov 2009 20:33:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/trying-to-write-a-ksh-script-to-remove-core-files-from/m-p/5211926#M464997</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-11-30T20:33:53Z</dc:date>
    </item>
    <item>
      <title>Re: trying to write a ksh script to remove core files from /</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/trying-to-write-a-ksh-script-to-remove-core-files-from/m-p/5211927#M464998</link>
      <description>If it is in root directory only, then you can&lt;BR /&gt;#! /usr/bin/ksh&lt;BR /&gt;if [[ -f /core ]]&lt;BR /&gt;then&lt;BR /&gt;   rm /core&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 30 Nov 2009 20:40:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/trying-to-write-a-ksh-script-to-remove-core-files-from/m-p/5211927#M464998</guid>
      <dc:creator>Tingli</dc:creator>
      <dc:date>2009-11-30T20:40:15Z</dc:date>
    </item>
    <item>
      <title>Re: trying to write a ksh script to remove core files from /</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/trying-to-write-a-ksh-script-to-remove-core-files-from/m-p/5211928#M464999</link>
      <description>&amp;gt; I want to keep it to just the root directory not just the root file system&lt;BR /&gt;&lt;BR /&gt;Why use the find commnad to find the core file in the / directory? What's wrong with "rm /core" or "ls /core"?&lt;BR /&gt;&lt;BR /&gt;If you want to prevent programs from generating core files in /, you can use the "ulimit -H -c 0" command in ksh (put in in /etc/profile or /.kshrc if it exists.</description>
      <pubDate>Mon, 30 Nov 2009 20:45:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/trying-to-write-a-ksh-script-to-remove-core-files-from/m-p/5211928#M464999</guid>
      <dc:creator>TTr</dc:creator>
      <dc:date>2009-11-30T20:45:07Z</dc:date>
    </item>
    <item>
      <title>Re: trying to write a ksh script to remove core files from /</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/trying-to-write-a-ksh-script-to-remove-core-files-from/m-p/5211929#M465000</link>
      <description>&amp;gt;TTr: If you want to prevent programs from generating core files in /,&lt;BR /&gt;&lt;BR /&gt;Or simply: mkdir /core</description>
      <pubDate>Mon, 30 Nov 2009 21:14:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/trying-to-write-a-ksh-script-to-remove-core-files-from/m-p/5211929#M465000</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2009-11-30T21:14:58Z</dc:date>
    </item>
    <item>
      <title>Re: trying to write a ksh script to remove core files from /</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/trying-to-write-a-ksh-script-to-remove-core-files-from/m-p/5211930#M465001</link>
      <description>I agree with Dennis.&lt;BR /&gt;&lt;BR /&gt;Just make a directory and chmod 000 on it.</description>
      <pubDate>Mon, 30 Nov 2009 23:34:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/trying-to-write-a-ksh-script-to-remove-core-files-from/m-p/5211930#M465001</guid>
      <dc:creator>D. Jackson_1</dc:creator>
      <dc:date>2009-11-30T23:34:59Z</dc:date>
    </item>
    <item>
      <title>Re: trying to write a ksh script to remove core files from /</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/trying-to-write-a-ksh-script-to-remove-core-files-from/m-p/5211931#M465002</link>
      <description>Probably the best way to control core files is to first identify the process(es) that created them. Then within the environment that the process runs (ie a startup script), set ulimit -c 0 which eliminates core files no matter where the process moves during execution.&lt;BR /&gt; &lt;BR /&gt;By the way, if the process actually creates a /core file (and not /etc/core or some other directory in the / filesystem), I would definitely change the environment of the program. The / directory is (should always be) 755 owned by root which means that the process can create (or remove) files in / -- not a good thing all. The program is already crashing. Another mistake in the program could remove all files in /. That could destroy your entire system.</description>
      <pubDate>Tue, 01 Dec 2009 01:47:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/trying-to-write-a-ksh-script-to-remove-core-files-from/m-p/5211931#M465002</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2009-12-01T01:47:32Z</dc:date>
    </item>
    <item>
      <title>Re: trying to write a ksh script to remove core files from /</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/trying-to-write-a-ksh-script-to-remove-core-files-from/m-p/5211932#M465003</link>
      <description>:) just be a bit careful with the statement from D. Jackson....&lt;BR /&gt;It is the new directory named core (that Dennis Handly mentioned), which you could run the chmod command on - by all means NOT the / itself - that would down your system ;)&lt;BR /&gt;&lt;BR /&gt;Anyway... it is not needed to do any chmod command on the directory, so the proposal is obsolete.&lt;BR /&gt;----------&lt;BR /&gt;&lt;BR /&gt;Trashing core-files like this should always be considered as a temporary fix. You should try to get rid of the core reason why these core files appear.&lt;BR /&gt;&lt;BR /&gt;To identify which program that dumped the core file, you could simply use:&lt;BR /&gt;    file /core&lt;BR /&gt;Normally you will get the name of the program and the interrupt signal (reason) why it dumped (see: man 5 signals)&lt;BR /&gt;This is at least a good starting point for investigating the root-cause without analyzing the dump completely.&lt;BR /&gt;&lt;BR /&gt;Best regards&lt;BR /&gt;/2r</description>
      <pubDate>Tue, 01 Dec 2009 07:57:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/trying-to-write-a-ksh-script-to-remove-core-files-from/m-p/5211932#M465003</guid>
      <dc:creator>Tor-Arne Nostdal</dc:creator>
      <dc:date>2009-12-01T07:57:04Z</dc:date>
    </item>
    <item>
      <title>Re: trying to write a ksh script to remove core files from /</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/trying-to-write-a-ksh-script-to-remove-core-files-from/m-p/5211933#M465004</link>
      <description>Hello Pamela,&lt;BR /&gt;1) # Limit the core file to 1G.&lt;BR /&gt;ulimit -c $((1024*1024*2))&lt;BR /&gt;&lt;BR /&gt;2) # Seek and show core dump files&lt;BR /&gt;find / -name core -type f -exec echo "\n" \; -exec file {} \; -exec what {} \; &lt;BR /&gt;&lt;BR /&gt;3) #remove&lt;BR /&gt;find / -name core -type f -exe rm -f {} \;&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Art&lt;BR /&gt;</description>
      <pubDate>Tue, 01 Dec 2009 09:21:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/trying-to-write-a-ksh-script-to-remove-core-files-from/m-p/5211933#M465004</guid>
      <dc:creator>Arturo Galbiati</dc:creator>
      <dc:date>2009-12-01T09:21:28Z</dc:date>
    </item>
    <item>
      <title>Re: trying to write a ksh script to remove core files from /</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/trying-to-write-a-ksh-script-to-remove-core-files-from/m-p/5211934#M465005</link>
      <description>Thanks for all the replies.  &lt;BR /&gt;&lt;BR /&gt;I would love to find out what process is dropping the core file and fix the cause of the problem.  The difficulty with that has been that it happens sporadically and when it does, it filled root so I could not get on the server to do any investigation.  &lt;BR /&gt;&lt;BR /&gt;I think I will try to limit the size of the core file so that it will not fill root the next time this happends.  This will allow me do get in and find out what is going on.  &lt;BR /&gt;&lt;BR /&gt;Thanks again!&lt;BR /&gt;Pam</description>
      <pubDate>Tue, 01 Dec 2009 13:29:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/trying-to-write-a-ksh-script-to-remove-core-files-from/m-p/5211934#M465005</guid>
      <dc:creator>PamelaJThrasher</dc:creator>
      <dc:date>2009-12-01T13:29:25Z</dc:date>
    </item>
    <item>
      <title>Re: trying to write a ksh script to remove core files from /</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/trying-to-write-a-ksh-script-to-remove-core-files-from/m-p/5211935#M465006</link>
      <description>Here is another thought.  Create a symbolic link in / for the core file to a file system that has enough space to contain the entire core file.  This way you can capture the entire core file for analysis.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 01 Dec 2009 17:06:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/trying-to-write-a-ksh-script-to-remove-core-files-from/m-p/5211935#M465006</guid>
      <dc:creator>Larry Klasmier</dc:creator>
      <dc:date>2009-12-01T17:06:45Z</dc:date>
    </item>
    <item>
      <title>Re: trying to write a ksh script to remove core files from /</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/trying-to-write-a-ksh-script-to-remove-core-files-from/m-p/5211936#M465007</link>
      <description>Be careful what "core" files you remove.&lt;BR /&gt;&lt;BR /&gt;There is a kernel module in HP-UX 11.31 PA-RISC named core (/usr/conf/mod/core).  If you remove it, you will not be able to compile a kernel.  Ignite recovery tapes will fail if the tapes was created without this core module on the server.</description>
      <pubDate>Tue, 01 Dec 2009 18:21:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/trying-to-write-a-ksh-script-to-remove-core-files-from/m-p/5211936#M465007</guid>
      <dc:creator>Robert Herron</dc:creator>
      <dc:date>2009-12-01T18:21:58Z</dc:date>
    </item>
    <item>
      <title>Re: trying to write a ksh script to remove core files from /</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/trying-to-write-a-ksh-script-to-remove-core-files-from/m-p/5211937#M465008</link>
      <description>Thanks.  All my 11.31 servers are Itanium.  I will still be careful.</description>
      <pubDate>Tue, 01 Dec 2009 18:23:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/trying-to-write-a-ksh-script-to-remove-core-files-from/m-p/5211937#M465008</guid>
      <dc:creator>PamelaJThrasher</dc:creator>
      <dc:date>2009-12-01T18:23:53Z</dc:date>
    </item>
    <item>
      <title>Re: trying to write a ksh script to remove core files from /</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/trying-to-write-a-ksh-script-to-remove-core-files-from/m-p/5211938#M465009</link>
      <description>&amp;gt;Pamela: All my 11.31 servers&lt;BR /&gt;&lt;BR /&gt;With 11.31, you can use coreadm(1m) to redirect or disable core files for all processes.&lt;BR /&gt;&lt;A href="http://docs.hp.com/en/B2355-60130/coreadm.1M.html" target="_blank"&gt;http://docs.hp.com/en/B2355-60130/coreadm.1M.html&lt;/A&gt;</description>
      <pubDate>Wed, 02 Dec 2009 03:23:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/trying-to-write-a-ksh-script-to-remove-core-files-from/m-p/5211938#M465009</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2009-12-02T03:23:41Z</dc:date>
    </item>
    <item>
      <title>Re: trying to write a ksh script to remove core files from /</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/trying-to-write-a-ksh-script-to-remove-core-files-from/m-p/5211939#M465010</link>
      <description>.</description>
      <pubDate>Wed, 02 Dec 2009 13:14:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/trying-to-write-a-ksh-script-to-remove-core-files-from/m-p/5211939#M465010</guid>
      <dc:creator>PamelaJThrasher</dc:creator>
      <dc:date>2009-12-02T13:14:31Z</dc:date>
    </item>
  </channel>
</rss>

