3 ms·
> Send the files .. without .. scp > cd && tar czv src | ssh example.com 'tar xz' Why would you not want to use scp? scp -r src/ example.com:~/target/ doe
by mseebach 15y ago
> Send the files .. without .. scp
> cd && tar czv src | ssh example.com 'tar xz'
Why would you not want to use scp?
scp -r src/ example.com:~/target/
does the same thing. Add -C for compression.
- jebblue 15y agoThat's faster from my experience than piping. Even faster, use rsync with the ssh option.
- BrandonM 15y agoTwo points: 1. The scp command is not quite the same because it's not maintaining all the file metadata the way that tar is. 2. The examples were mostly intended to be illustrative, showing that you can do things like cd around on the remote machine before receiving/sending the data across the SSH pipe. My VNC server example near the bottom of the post was a more useful example of the type of thing you can do with SSH that doesn't have another easy solution.