LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.

Notices


Reply
  Search this Thread
Old 09-11-2013, 01:34 AM   #1
sluge
Member
 
Registered: Dec 2006
Location: Russia,52
Posts: 128

Rep: Reputation: 6
Question How to extract archive via network


Hello!
On server1 I have a archive.tar.gz file. I need to extract it using ssh to server2.
So, I write the commans:

# ssh server2 < archive.tar.gz | gunzip -c | tar -xf - -C /home/

But I got an error:
Pseudo-terminal will not be allocated because stdin is not a terminal.

How to copy the file correctly?
 
Old 09-11-2013, 04:15 AM   #2
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
Code:
ssh server2 < archive.tar.gz "tar -xzf - -C /home/"
assumes your tar can handle the decompression ( the z arg )
- on its own is read from stdin


if your tar doesn’t handle the decompression
Code:
ssh server2 < archive.tar.gz "gunzip - | tar -xzf - -C /home/"
Note, you probably won't need the - with the tar, since the | implies it
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to extract HIT archive data chinabenjamin66 Linux - Newbie 4 12-07-2012 08:42 AM
Error trying to extract a tgz archive gemboek Linux - Newbie 4 09-18-2011 03:26 PM
Right click extract Archive stopped working Zero4 Linux - Newbie 3 03-16-2011 08:04 PM
How can I extract a file from iso archive kmichal2 Linux - Software 8 12-14-2004 05:48 AM
Making C extract an archive MylesCLin Programming 2 12-13-2004 05:48 AM

LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris

All times are GMT -5. The time now is 08:06 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration