Solved

copying file from one sles box to another

Posted on 2010-11-28
5
549 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 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

773 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