- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: data collection script needed
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
08-27-2002 02:51 AM
08-27-2002 02:51 AM
I'd like to have a script which will copy collected data from one server to my admin server. I have to submit the output from a check script to HP.
I looked up and tried several recommended scripts in the forum, but I couldn't get them to work.
I would like to use a file containing all machine names.
something like
#############
for server in server_list.txt
do
remsh server rcp -p collected_data_file admin_server:/collection_dir/
done
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-27-2002 02:56 AM
08-27-2002 02:56 AM
Solutionfor server in `cat server_list.txt`
do
rcp -p $server:collected_data_file /collection_dir
done
You'll just need to put in the full path to your collected data file. I assume that the files have unique names so that they don't overwrite one another when you copy them to your admin server.
Chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-27-2002 03:24 AM
08-27-2002 03:24 AM
Re: data collection script needed
but
Doesn't the collection_dir need a machine name to copy to?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-27-2002 03:36 AM
08-27-2002 03:36 AM
Re: data collection script needed
rcp -rp $server:/directory/to/copy RECEIVINGhostname:/directory2put_itin
ie: If I am on serverA and I want to copy files from serverK to serverU, I would do this:
[serverA:root]# rcp -rp serverK:/var/datafiles serverU:/var/collectionpoint
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-27-2002 03:38 AM
08-27-2002 03:38 AM
Re: data collection script needed
rcp -rp serverK:/var/datafiles serverA:/var/collectionpoint
OR
rcp -rp serverK:/var/datafiles /var/collectionpoint
OR
cd /var/collectionpoint
rcp -rp serverK:/var/datafiles .
OR
cd /var/collectionpoint
rcp -rp serverK:/var/datafiles serverA:.
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-27-2002 06:54 AM
08-27-2002 06:54 AM
Re: data collection script needed
#!/bin/sh
exec > /home/richard/bin/nick.txt 2> /home/richard/bin/nick_err.txt
echo 'starting time'
date
REMOTES=/home/richard/cron/hostnames1
for REMOTE in $(cat $REMOTES)
do
echo '#####################'
rcp -p -r root@${REMOTE}:/path/to/data/you/want.* /path/on/admin/server
done
Ok here is how you get the script to work.
exec > /home/richard/bin/nick.txt 2> /home/richard/bin/nick_err.txt
This will produce a log with error and output. Change the path to where you want the script to log or comment this part out if you dont care about logs.
REMOTES=/home/richard/cron/hostnames1
the hostnames1 file is a file with a list of hostnames or IPaddress you want to get the information from change this to the path where you want to run the script from. the file should look like this:
hosta
hostb
hostc
rcp -p -r root@${REMOTE}:/path/to/data/you/want.* /path/on/admin/server
This command goes out to the "remote" host from the hostnames list and goes to the
path of the data you want and puts it in the path on the admin server.
~Richard
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-27-2002 10:41 PM
08-27-2002 10:41 PM
Re: data collection script needed
I have printed this stuff and will keep it in my little admin library.
I didn't give out any 10's because I didn't want to close the tread.
:wq!
cd pub
more beer