Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
google site



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

Closed Thread
English Japanese Spanish French German Portuguese Italian Powered by Powered by Google
 
Thread Tools Search this Thread Display Modes
  #1  
Old 03-08-2006
thumper thumper is offline VIP Member  
Supporter
 

Join Date: Feb 2005
Posts: 49
Thanks: 0
Thanked 0 Times in 0 Posts
Sending tar output to a remote host

Our group has recently inherited 15 servers that have not been maintained for over a year.
My first action is to backup the units however there is not enough disk space on most of them to run tar. My supervisor said to look at piping the tar output to another machine, however I have been unable to get this to work.
I tried the command below
tar -cv test.tar acc/ - | ssh user@sport:/home/user/temp/
but I get the error message Pseudo-terminal will not be allocated because stdin is not a terminal.

I could use some help getting started on this since I dont know where to go from here.
Links to appropriate reading would also be greatly appreciated.
Thanks
Sponsored Links
  #2  
Old 03-08-2006
blowtorch's Avatar
AFK
 

Join Date: Dec 2004
Location: Singapore
Posts: 2,351
Thanks: 0
Thanked 1 Time in 1 Post
You've almost got the command. You have forgotten to use tar on the other side of the ssh and the tar on the local server has some problems as well. Here you go:

Code:
tar -cf - acc/ | ssh user@sport (cd /home/user/temp; tar -xf - )

You can stick a 'v' in the tar command if you want verbose output.
  #3  
Old 03-08-2006
thumper thumper is offline VIP Member  
Supporter
 

Join Date: Feb 2005
Posts: 49
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by blowtorch
You've almost got the command. You have forgotten to use tar on the other side of the ssh and the tar on the local server has some problems as well. Here you go:

Code:
tar -cf - acc/ | ssh user@sport (cd /home/user/temp; tar -xf - )

You can stick a 'v' in the tar command if you want verbose output.
Thanks Blowtorch. I've got a question on the command you show. Why is the tar -xf - needed? Since I dont want to untar the file on the server as it is going to be written to a tape should the command be
tar -cf - acc/ | ssh user@sport (cd /home/user/temp )

Also, I've also come across the netcat command and it looks like it might work equally well. Is there any advantage to using either netcat or ssh?

Thanks for the help.
  #4  
Old 03-08-2006
blowtorch's Avatar
AFK
 

Join Date: Dec 2004
Location: Singapore
Posts: 2,351
Thanks: 0
Thanked 1 Time in 1 Post
Oh, OK. My mistake. I thought this was a simple transfer of files thing. Can you try this command instead?


Code:
tar -cf - *|ssh -l remote_user remote_host cd /some/tmp/dir\; tar -xf -\;tar -cf /path/to/tape \*

Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Sending Commands to a Remote Host safetytrick UNIX for Dummies Questions & Answers 3 08-18-2007 06:29 PM
How to delete the files from local host to remote host krishna176 Solaris 3 03-24-2007 03:48 PM
tnsping at local and remote host? milo Shell Programming and Scripting 1 03-16-2007 10:12 AM
How to specify the remote host? redlotus72 UNIX for Dummies Questions & Answers 2 07-21-2005 05:21 AM
FTP - Connection Closed By Remote Host mouglybean IP Networking 1 10-26-2004 09:15 AM



All times are GMT -4. The time now is 11:59 PM.