Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need to transfer output of tar command directly to host without saving the file #719

Open
kholoudasem opened this issue Sep 7, 2021 · 3 comments

Comments

@kholoudasem
Copy link

kholoudasem commented Sep 7, 2021

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,

@kholoudasem
Copy link
Author

@hierynomus Any updates here ??

@hierynomus
Copy link
Owner

You can get an inputstream from an SFTP/SCP and pass that through a TarInputStream (see https://commons.apache.org/proper/commons-compress/)

@hierynomus
Copy link
Owner

@kholoudasem Does it now work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants