Solved

copying file from one sles box to another

Posted on 2010-11-28
5
558 Views
Last Modified: 2012-06-27
What command would one use in Suse Linux to copy a file in terminal from one linux machine to another?  One has the ip address of 192.168.0.245 and contains a file I want to transfer to a server with an ip of 192.168.0.13.  I tried using scp couldn't get it to work after I archived the info I needed into a tar file.  Is there another command that works better?

Thanks
0
Comment
Question by:Peterson50
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 16

Expert Comment

by:Joseph Gan
ID: 34227719
0
 
LVL 9

Expert Comment

by:crazedsanity
ID: 34230463
If you're attempting to use scp to pull files from a remote machine that exist within a tar archive, you probably won't have much success; you may want to consider either extracting the contents or using some scripting over ssh to get it done:

ssh 192.168.0.13 "tar zxf file.tgz (options)"

Open in new window


Using this code, you can extract the file and copy it over the SSH tunnel (similar to scp), echo its contents, etc.  Google for information on the tar command and you should find what you need.  If you need more info, let me know.
0
 

Author Comment

by:Peterson50
ID: 34231118
The server at .0245 has a barebones linux installation as we are attempting to perform a disaster recovery.  Since we had an issue with it we needed to zip a directory which we did and now copy that to another machine using some utility.  I was attempting to copy the entire tar file I created from one machine to another and though it would work.   How do I redirect the ssh tar extration to a folder on my in use system (not the barebone system which contains the tar)
Thanks
0
 
LVL 9

Accepted Solution

by:
crazedsanity earned 500 total points
ID: 34231236
I would just scp the entire zip file to the destination server:

scp user@192.168.0.245:/path/to/file.tgz /path/to/temp/destination

Open in new window


After that, just unzip the file:

cd /path/to/destination; tar zxvf file.tgz

Open in new window


Once that is done, you can move the data from the extracted directory to wherever it needs to be.
0
 

Author Closing Comment

by:Peterson50
ID: 34241180
Worked perfectly
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Are you sitting there reading this and wondering how to get started with Linux? It almost seems like picking the right Linux distribution is about like picking the right college or buying a new car if you read some of the article out there. Relax… l…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question