Untarring archive over lan via ssh stalling/failing

Hello Experts!

I needed to restore a directory from backups on my workstation.  My backups are tar archives on my backup server. I tried the following command" cat cmottus01-Tue-differential.tgz - | ssh cmottus01 "cd /;tar zxvf - home".  The command seemed to work fine as I could watch many files being restored, however after a couple of minutes the process would stop.  When I would check top, the tar, gzip and ssh processes would be stopped.  There was plenty of room on the disk and I let it go all night and it was still stalled the next morning. Eventually I copied the archives to my workstation and restored locally and it worked perfectly.

Why would the process stop?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

try scp the file to the remote server first and the execute the tar command locally, at least that would help you troubleshoot.
PEI_ITAuthor Commented:
I did do it locally.   Thats how I got it too work. It untars great if I do it locally.  The problem was that my workstation did not have enough disk space for the newest incremental.tgz and the untarred directory.  Thats why I tried using this method.
Pétur Ingi EgilssonSoftware Engineer -- ConsultantCommented:
execute the tar command on the remote server.
copy all your files over to your computer with scp or rsync
delete the files from the remote server
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

PEI_ITAuthor Commented:
Thank you for you answers, but I understand all that.  What I am curious about is why untarring fails when I am doing it via an ssh to a remote server.
nociSoftware EngineerCommented:
ssh might interpret some data if you use it like this... It act uponm some ~{char} sequences
as you probably need to set the escape charater (~) to none.
option on the command line -e none
or in the ~/.ssh/ssh_config file "EscapeChar = none"

Disabling the escapechar should make your session 'tranparant'
see also man ssh.
nociSoftware EngineerCommented:
BTW. If security is not the reason why you started with ssh. then nc (netcat) or sokat
might be faster replacements for transporting sockets over a network.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
PEI_ITAuthor Commented:
Netcat did the trick!  Awesome!

On my workstation I opened port 6666 and then changed to the target directory.  I then entered "# nc -v -w 30 -p 6666 -l | tar zxvf - home" at the command prompt and hit enter.

On the backup server I changed to the directory with the archives and entered the following command "nc -v -w 2 workstation01 6666 < Backup-Sun-full.tgz" and hit enter.

The archive was streamed from my backup server to my workstation and untared to the target directory. I also refered to http://www.oreilly.com/pub/h/1058 for the command syntax.

Cheers noci!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
SSH / Telnet Software

From novice to tech pro — start learning today.