- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- script to copy user files.
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-12-2002 08:50 AM
11-12-2002 08:50 AM
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..
Thanks
David.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-12-2002 08:54 AM
11-12-2002 08:54 AM
Re: script to copy user files.
eg. cd $HOME
ln -s
or what we do is ln -s /dev/null core so no more core files!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-12-2002 08:59 AM
11-12-2002 08:59 AM
Re: script to copy user files.
Thanks.
Good idea but i guess we are not suppose to use NFS.
Thanks
David.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-12-2002 09:04 AM
11-12-2002 09:04 AM
Re: script to copy user files.
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.
As ever in UNIX, there are many ways to skin the proverbial cat.
Regards,
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-12-2002 09:15 AM
11-12-2002 09:15 AM
Re: script to copy user files.
If your requirement is to use "rcp", then you have the how part of your answer.
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.
HTH
-- Rod Hills
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-12-2002 09:26 AM
11-12-2002 09:26 AM
Re: script to copy user files.
# find /home -name core -exec rcp {} mars:/tmp \;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-12-2002 09:28 AM
11-12-2002 09:28 AM
Re: script to copy user files.
# find /home -name core -exec rcp {} /tmp \;
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-12-2002 10:15 AM
11-12-2002 10:15 AM
Re: script to copy user files.
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.
Thanks
David.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-12-2002 10:23 AM
11-12-2002 10:23 AM
Re: script to copy user files.
- works out the username
- kills the process
- waits for the core file to be written
- moves the core file to your remote server
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.
Your filename on the remote server ought to have some sort of date/time extension otherwise you'll be continually overwriting the same file.
I still don't know why you want to do this though. We just trash ours.
Regards,
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-12-2002 01:54 PM
11-12-2002 01:54 PM
Re: script to copy user files.
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.
example-
#!/usr/bin/ksh
trap "rcp core otherhost:/tmp/savecore" 3
/run/your/application
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.
HTH
-- Rod Hills
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2002 03:25 PM
11-13-2002 03:25 PM
Solutionfind /home -name core -exec rcp {}remote:/tmp/core.`date +'%m%d%H%M'` \;
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.
Good Luck.
Steve