sshj
sshj copied to clipboard
Need to transfer output of tar command directly to host without saving the file
Hello @hierynomus ,
I need support to get the output of a tar command directly on my host machine without the need to save the large file on the target. Is there a way to do this as in pipes or something similar using SSHJ ?
In cmd I can do it with something like:
ssh root@localhost tar czf - /tmp > C:\somedirectory\test.tar
I need to do the same using SSHJ
Thanks in advance,
@hierynomus Any updates here ??
You can get an inputstream from an SFTP/SCP and pass that through a TarInputStream (see https://commons.apache.org/proper/commons-compress/)
@kholoudasem Does it now work?