Quantcast
Channel: scp and compress at the same time, no intermediate save - Unix & Linux Stack Exchange
Viewing all articles
Browse latest Browse all 4

Answer by tsionyx for scp and compress at the same time, no intermediate save

$
0
0

Small improvement for the dkbhadeshiya's answer: you don't have to do cd dir, just specify working directory to the tar instead:

ssh user@host "tar -C /path/to/data/ -zc directory_name" | tar zx 

You can also upload directory the same way:

tar zc directory_name/ | ssh user@host "tar zx -C /new/path/to/data/"

Viewing all articles
Browse latest Browse all 4

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>