LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-18-2006, 11:22 AM   #1
uselpa
Senior Member
 
Registered: Oct 2004
Location: Luxemburg
Distribution: Slackware, OS X
Posts: 1,507

Rep: Reputation: 47
trouble with tar and netcat


I am trying to backup my machine onto another machine using tar and netcat with no success.
On the receiving machine, I issue a
Code:
nc -vl -p 9000 > image.tar.gz
On the sending machine, I boot with a RIP CD, mount the partition I want to backup as read-only, cd to the mountpoint and issue
Code:
tar czvf - * | nc 192.168.1.2 9000
The processing starts for some time but then appears to hang, without any message.
I then have 0% CPU on both machines but both respond perfectly in other virtual terminals. The filesystem on the receiving end still has space left. Removing compression doesn't change anything.
The last 2 times I checked, the last name to be printed by tar was always the same. The filename of the last processed file has no strange characters.
Has anybody had similar issues?

EDIT: the problem seems to be that tar does not send an EOF to netcat so netcat just seems to continue listening.

Last edited by uselpa; 03-18-2006 at 11:41 AM.
 
Old 03-18-2006, 12:58 PM   #2
nixcraft
Member
 
Registered: Nov 2004
Location: BIOS
Distribution: RHEL3.0, FreeBSD 5.x, Debian 3.x, Soaris x86 v10
Posts: 379

Rep: Reputation: 30
You can use ssh over tar; via you are using netcat?
 
Old 03-18-2006, 01:27 PM   #3
uselpa
Senior Member
 
Registered: Oct 2004
Location: Luxemburg
Distribution: Slackware, OS X
Posts: 1,507

Original Poster
Rep: Reputation: 47
tar over ssh uses a lot of CPU and as I am on a completely isolated LAN, there's no need for ssh. OTOH I tried to use NFS instead of netcat, and that worked fine, but it takes a little bit more work to set up.

In the meantime I found the answer myself (after taking nearly one day to figure out that it was an EOF problem): just add "-q 0" to both nc commands, and netcat will quit immediately at the first EOF.
 
  


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 can i decompress this tar.tar file? hmmm sounds new.. tar.tar.. help ;) kublador Linux - Software 14 10-25-2016 02:48 AM
still having trouble installing tar.gz bobber Linux - Software 3 02-01-2006 04:05 PM
trouble with tar files moborichard Linux - Software 4 04-01-2005 10:35 PM
trouble with tar.gz files liquidjojo Linux - Newbie 4 03-30-2005 09:51 PM
Trouble with tar junwen Linux - Newbie 1 03-09-2005 02:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 11:44 AM.

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