Streaming folders from a server over SSH using tar and gzip

This is how you can stream a folder or multiple folders from a server over SSH protocol.

To stream folders in uncompressed, raw format, run:

Since the tar file is being streamed raw, this could potentially take longer as more data is being passed between server and client. In my test for 700 megabytes of data, this command took 1:56 seconds.

There’s another method. This streams the tar file, pipes it into gzip on the remote server which comes out as compressed gzipped stream down to the client. The client then passes this compressed stream into gunzip which decompresses the stream and finally then pipes it into tar to extract it into its original folders.

With the same data as above, this method took smaller amount of time, 1:13 seconds to be exact.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.