Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

copying file from one sles box to another

Posted on 2010-11-28
5
Medium Priority
?
570 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
  • 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 2000 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

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

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

1. Introduction As many people are interested in Linux but not as many are interested or knowledgeable (enough) to install Linux on their system, here is a safe way to try out Linux on your existing (Windows) system. The idea is that you insta…
The purpose of this article is to show how we can create Linux Mint virtual machine using Oracle Virtual Box. To install Linux Mint we have to download the ISO file from its website i.e. http://www.linuxmint.com. Once you open the link you will see …
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Suggested Courses

885 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