- SSH into a remote box and execute a command
ssh firstname.lastname@example.org "command"
- The "
command" to execute dumps a file to std out
cat my-app.sql, then compress that stream back to STDOUT
| gzip -c
- Pipe the compressed stream through your local machine and get some stats and transfer status
- Decompress the stream on the fly
- Redirect the stream to a file on your local machine
Putting it all together:
$ ssh email@example.com "cat my-app.sql | gzip -c" | pv | gunzip > tmp/my-app.sql