<?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: script to copy user files. in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-copy-user-files/m-p/2843295#M91633</link>
    <description>Hi Stephan:&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;BR /&gt;&lt;BR /&gt;Good idea but i guess we are not suppose to use NFS.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;David.</description>
    <pubDate>Tue, 12 Nov 2002 16:59:08 GMT</pubDate>
    <dc:creator>david_252</dc:creator>
    <dc:date>2002-11-12T16:59:08Z</dc:date>
    <item>
      <title>script to copy user files.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-copy-user-files/m-p/2843293#M91631</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt; We have 800 users on our nclass box running 11.0 and they create core files in their home directories say /home/$USER/core. They also create a core when we kill some process with a -6 signal(orphan process) we have a requirement to rcp this core files to a remote box. How do i go about doing this each and every time as we have at least 15 core files a day. Any ideas..&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;David.</description>
      <pubDate>Tue, 12 Nov 2002 16:50:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-copy-user-files/m-p/2843293#M91631</guid>
      <dc:creator>david_252</dc:creator>
      <dc:date>2002-11-12T16:50:41Z</dc:date>
    </item>
    <item>
      <title>Re: script to copy user files.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-copy-user-files/m-p/2843294#M91632</link>
      <description>How about nfs mount the remote server to your local server, and in each users home dir create a symbolic link for core to point to the nfs mounted dir of the remote server - this way no need to rcp, all core files automatically created on the remote servers filesystem ?&lt;BR /&gt;&lt;BR /&gt;eg. cd $HOME&lt;BR /&gt;ln -s &lt;REMOTE server="" nfs="" mountpoint=""&gt;/core core&lt;BR /&gt;&lt;BR /&gt;or what we do is ln -s /dev/null core so no more core files!&lt;BR /&gt;&lt;/REMOTE&gt;</description>
      <pubDate>Tue, 12 Nov 2002 16:54:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-copy-user-files/m-p/2843294#M91632</guid>
      <dc:creator>Stefan Farrelly</dc:creator>
      <dc:date>2002-11-12T16:54:27Z</dc:date>
    </item>
    <item>
      <title>Re: script to copy user files.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-copy-user-files/m-p/2843295#M91633</link>
      <description>Hi Stephan:&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;BR /&gt;&lt;BR /&gt;Good idea but i guess we are not suppose to use NFS.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;David.</description>
      <pubDate>Tue, 12 Nov 2002 16:59:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-copy-user-files/m-p/2843295#M91633</guid>
      <dc:creator>david_252</dc:creator>
      <dc:date>2002-11-12T16:59:08Z</dc:date>
    </item>
    <item>
      <title>Re: script to copy user files.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-copy-user-files/m-p/2843296#M91634</link>
      <description>A conventional approach would be to write a script which combines 'find' and 'rcp' to locate and copy the core files to the remote server. Then use 'cron' to run the script on a regular basis.&lt;BR /&gt;&lt;BR /&gt;If you do a lot of kill -6's then you could script this also and follow the kill with an rcp of the resulting core file.&lt;BR /&gt;&lt;BR /&gt;As ever in UNIX, there are many ways to skin the proverbial cat.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;John</description>
      <pubDate>Tue, 12 Nov 2002 17:04:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-copy-user-files/m-p/2843296#M91634</guid>
      <dc:creator>John Palmer</dc:creator>
      <dc:date>2002-11-12T17:04:01Z</dc:date>
    </item>
    <item>
      <title>Re: script to copy user files.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-copy-user-files/m-p/2843297#M91635</link>
      <description>David,&lt;BR /&gt;&lt;BR /&gt;If your requirement is to use "rcp", then you have the how part of your answer.&lt;BR /&gt;&lt;BR /&gt;If your question is about how to schedule this task as per the statement "doing this each and every time", then you would set up a crontab entry (see man crontab) to run the task as needed. Either once at the end of the day or every 2 hours.&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;&lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Tue, 12 Nov 2002 17:15:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-copy-user-files/m-p/2843297#M91635</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2002-11-12T17:15:44Z</dc:date>
    </item>
    <item>
      <title>Re: script to copy user files.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-copy-user-files/m-p/2843298#M91636</link>
      <description>sorry ..&lt;BR /&gt;# find /home -name core -exec rcp {} mars:/tmp \;</description>
      <pubDate>Tue, 12 Nov 2002 17:26:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-copy-user-files/m-p/2843298#M91636</guid>
      <dc:creator>S.K. Chan</dc:creator>
      <dc:date>2002-11-12T17:26:07Z</dc:date>
    </item>
    <item>
      <title>Re: script to copy user files.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-copy-user-files/m-p/2843299#M91637</link>
      <description>Something as simple as this may work for you. Copying all found "core" files to remote server "mars" and put all of them in /tmp.&lt;BR /&gt;# find /home -name core -exec rcp {} /tmp \;&lt;BR /&gt;Let this run from cron on a daily basis. It seems odd why would you want to keep core files unless the crash is important enough for you to analyze it. Here we just blow 'em away from cron once a week.</description>
      <pubDate>Tue, 12 Nov 2002 17:28:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-copy-user-files/m-p/2843299#M91637</guid>
      <dc:creator>S.K. Chan</dc:creator>
      <dc:date>2002-11-12T17:28:52Z</dc:date>
    </item>
    <item>
      <title>Re: script to copy user files.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-copy-user-files/m-p/2843300#M91638</link>
      <description>Thanks everyone.&lt;BR /&gt;&lt;BR /&gt;we may have more than 3 files for a particular user the same day. After copying the files the core files should be deleted(since we have to be ready to copy the next one) What would be a good idea to go that way. Also since we also generate some cores using kill -6 is it possible to differentiate those cores(kill -6) from the other cores. All cores however would land up in the home directory.&lt;BR /&gt;&lt;BR /&gt;Thanks &lt;BR /&gt;David.</description>
      <pubDate>Tue, 12 Nov 2002 18:15:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-copy-user-files/m-p/2843300#M91638</guid>
      <dc:creator>david_252</dc:creator>
      <dc:date>2002-11-12T18:15:58Z</dc:date>
    </item>
    <item>
      <title>Re: script to copy user files.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-copy-user-files/m-p/2843301#M91639</link>
      <description>As I stated earlier, you could write a script that does the following:&lt;BR /&gt;- works out the username&lt;BR /&gt;- kills the process&lt;BR /&gt;- waits for the core file to be written&lt;BR /&gt;- moves the core file to your remote server&lt;BR /&gt;&lt;BR /&gt;Core files are written to the current directory of the process that produces them so if that isn't the user's home directory, finding the right one could be difficult.&lt;BR /&gt;&lt;BR /&gt;Your filename on the remote server ought to have some sort of date/time extension otherwise you'll be continually overwriting the same file.&lt;BR /&gt;&lt;BR /&gt;I still don't know why you want to do this though. We just trash ours.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;John&lt;BR /&gt;</description>
      <pubDate>Tue, 12 Nov 2002 18:23:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-copy-user-files/m-p/2843301#M91639</guid>
      <dc:creator>John Palmer</dc:creator>
      <dc:date>2002-11-12T18:23:01Z</dc:date>
    </item>
    <item>
      <title>Re: script to copy user files.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-copy-user-files/m-p/2843302#M91640</link>
      <description>David,&lt;BR /&gt;&lt;BR /&gt;If this a specific application you are trying to capture the "core" files, would it be possible to wrap a shell script around the launch of the application. If so, then you could use "trap" to capture the application when it generates a core dump.&lt;BR /&gt;&lt;BR /&gt;example-&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/ksh&lt;BR /&gt;trap "rcp core otherhost:/tmp/savecore"  3&lt;BR /&gt;/run/your/application&lt;BR /&gt;&lt;BR /&gt;This way if a core dump is created, then the rcp would be run. You may want to add additional code to make the "core" file names unique at the destination.&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;&lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Tue, 12 Nov 2002 21:54:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-copy-user-files/m-p/2843302#M91640</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2002-11-12T21:54:05Z</dc:date>
    </item>
    <item>
      <title>Re: script to copy user files.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-copy-user-files/m-p/2843303#M91641</link>
      <description>The thing to be careful of is if you continuously cp core without a renaming convention, you will always overwrite previous cores that you may have needed. You may want to try something like&lt;BR /&gt;find /home -name core -exec rcp {}remote:/tmp/core.`date +'%m%d%H%M'` \;&lt;BR /&gt;&lt;BR /&gt;This should copy the file to the remote server with a name of core.11131345 as an example for Nov. 13 at 1:45pm. You could modify the time stamps as you like. If you ran this as a cron job every 5-10 minutes the likelihood of duplicates would probably be decreased.&lt;BR /&gt;&lt;BR /&gt;Good Luck.&lt;BR /&gt;&lt;BR /&gt;Steve&lt;BR /&gt;</description>
      <pubDate>Wed, 13 Nov 2002 23:25:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-copy-user-files/m-p/2843303#M91641</guid>
      <dc:creator>Steve Labar</dc:creator>
      <dc:date>2002-11-13T23:25:32Z</dc:date>
    </item>
  </channel>
</rss>

