- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Copying files from one server to another on re...
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
Discussions
Discussions
Forums
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
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
тАО03-09-2009 02:43 AM
тАО03-09-2009 02:43 AM
I have an HP Unix 11.11 server let say server A and another server B. On hourly bases, i want to copy some friles created on server A, on to the server B. Can anyone tell me what would be the best method and how could i accomplish this taks.
1. On which server should i schedule the cron job?
2. Which command would i use in the script which will copy files from server A to the server B (ftp, scp etc).
3. How the script will look like which will perform this taks.
I am very new in HP so i am not sure how to do this.
Thanks
Salman
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-09-2009 03:03 AM
тАО03-09-2009 03:03 AM
Re: Copying files from one server to another on regular bases
I'd use scp to copy the files in question. If you are going to run it via cron you're going to need to setup authentication for the user doing the copy...
- logon to server A as the user who will initiate the copy
- if no ssh public keys exist in ~/.ssh or ~/.ssh2 then use ssh-keygen
- add the contents on the .pub key to the authorized_keys file on serverB:~/.ssh
- use scp to test the transfer works without a password (on serverA scp /path/to/file serverB:/path/to/destination)
if it works schedule it via cron
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-09-2009 03:10 AM
тАО03-09-2009 03:10 AM
Re: Copying files from one server to another on regular bases
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-09-2009 03:19 AM
тАО03-09-2009 03:19 AM
Re: Copying files from one server to another on regular bases
Files which you are going to copy is same everytime, rsync would be best option. It will update only the modifications instead of copying the entire file everytime.
Files are going to be different you can go for other options like scp, rcp . You need to setup passwordless logins for scp as specified by Richard.
Ganesh.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-09-2009 03:34 AM
тАО03-09-2009 03:34 AM
Re: Copying files from one server to another on regular bases
Your suggestion seems to be good in my environment. Can you please explain a bit about following two points
- if no ssh public keys exist in ~/.ssh or ~/.ssh2 then use ssh-keygen
How to perform this operation?
- add the contents on the .pub key to the authorized_keys file on serverB:~/.s
I also don't understand this, can you please explian this a bit.
To other people, thanks for your reply but i can't go for sync since every time files will be new.
Salman
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-09-2009 03:47 AM
тАО03-09-2009 03:47 AM
Solution- logon to serverA as user doing transfer
- ssh-keygen -t dsa
- cat ~/.ssh/id_dsa.pub (copy contents)
- logon to serverB as user doing transfer
- cd ~/.ssh
- vi authorized_keys (paste contents from key above)
regards,
Richard
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-09-2009 04:05 AM
тАО03-09-2009 04:05 AM
Re: Copying files from one server to another on regular bases
Other than generating public key and copy it to destination, you should set the proper permissions. Otherwise passwordless login will not work.
Make sure the following permissions are set in destination server(Server B in your case)
Home directory should have 755 permission (users home directory)
$HOME/.ssh directory should have 700 permission
$HOME/.ssh/authorized_keys file should have 600 permission
Ganesh.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-09-2009 05:52 AM
тАО03-09-2009 05:52 AM
Re: Copying files from one server to another on regular bases
cd $SYNC_DIR ; $RSYNC_BIN -avtz --rsync-path=$RSYNC_BIN --rsh="ssh -l $USER" . $DEST:$SYNC_DIR
Take a look at rsync docs.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-09-2009 11:42 PM
тАО03-09-2009 11:42 PM
Re: Copying files from one server to another on regular bases
ssh-keygen is not present on my server. I tried to find out from the server but it is not there. What to do now and how to install this ssh-keygen so that i could go ahead.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-09-2009 11:53 PM
тАО03-09-2009 11:53 PM
Re: Copying files from one server to another on regular bases
You can get ssh here:
http://h20293.www2.hp.com/portal/swdepot/displayProductInfo.do?productNumber=T1471AA