- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Remote Copy help
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
тАО10-13-2005 02:51 AM
тАО10-13-2005 02:51 AM
How do I do a remote copy from one Linux server to another Linux server? Let's say that I have options to log in to another server using ssh & telnet with "root" privs.
I need to copy entire folder from one linux server to another linux server. I am currently using Redhat 2.1 AS
Please help!!
Thank you in advance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-13-2005 03:03 AM
тАО10-13-2005 03:03 AM
SolutionIn the source host, run:
scp -rp localfolder username@remotehost:/path/to/destination_directory
Like this:
scp -rp mydir root@host.example.com:/home/
The use of root is not recommended for security reasons.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-13-2005 04:22 AM
тАО10-13-2005 04:22 AM
Re: Remote Copy help
I should run this command from the server that I am trying to copy the data to, right?
Example: I have to server and they're x and y - and I am trying to copy data from y to x. The command are as follows:
scp -rp \temp root@y:/tmp/temp
This is correct? I hate to make a mistake by copying over the old stuff )-:
Thanks so much for your help!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-13-2005 07:14 AM
тАО10-13-2005 07:14 AM
Re: Remote Copy help
Server 1 has the data to be copied. The mydata dir, located in /tmp (/tmp/mydatadir).
Server 2 is the destination. And should be placed in the /data directory.
You can do it from server 1 or server 2. Try to find out the differences in these examples:
From server1:
server1# scp -rp /tmp/mydatadir root@server2:/data
From server2:
server2# scp -rp server1:/tmp/mydatadir /data
Do you see the difference? The sintax is server:/location, and the order specifies if this is origin or destination.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-13-2005 10:06 PM
тАО10-13-2005 10:06 PM
Re: Remote Copy help
man rsync should give you all you need (I'm assuming it is installed).
it is a file transfer utility that 'synchronises' files (or directories) from the source to the destination.
If you subsequently make a change to the files and re-run rsync, it will only transfer the differences, not the entire files all over again.
By default, rsync uses ssh for the comms, but you can also setup an rsync server that you can pull/push files from/to
An example of transferring an entire directory from server1 to server2 would be:
rsync -Cavz /opt/somedir server2:/opt/
The C option will back up any files that would be overwritten, 'a' is for archive mode (copy file properties as well as the file), 'v' verbose ;-) and 'z' to use compression (usefull on tight bandwidth).
You could even issue the command from a third server:
rsync -Cavz server1:/opt/somedir server2:/opt/
if ssh authorisation keys have not been exchanged, you'll be asked to enter passwords. If you have set up keys already, then things get even easier!
Good luck.
Regards,
Andy Bruce
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-14-2005 05:17 AM
тАО10-14-2005 05:17 AM
Re: Remote Copy help
#tar -zcf - /yourdir | ssh dest_server tar -zxf - -C /dest_dir
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-16-2005 09:29 PM
тАО10-16-2005 09:29 PM
Re: Remote Copy help
#tar -zcf - /yourdir | ssh dest_server tar -zxf - -C /dest_dir
is easier (better) than
# rsync -Cavz /opt/somedir server2:/opt/
???
You can't be a wizard!!! You must be impersonating Ivajlo Yanakiev, and I claim my 10 points! :-)
A.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-16-2005 10:41 PM
тАО10-16-2005 10:41 PM
Re: Remote Copy help
a) You can use scp
b) sftp
c) ftp -in
bin
cd /remote
lcd /local
mget *
bye
EOF
hth.