I have two Solaris servers. On server1 I have a file, archive.tar.gz
. I need to extract it using ssh to server2.
So, I write the commands:
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?
Best Answer
I believe you could do something like this:
If you need to control the directory where it gets extracted to on server2:
Solaris
Given you're on Solaris your version of tar is likely to not include any of the compression features that GNU tar offers. Fear not you can still do this command, we just need to decompose the cat
archive.tar.gz
into a command that can first uncompress the tarball.Something like this should do:
Or this:
Or this: