Stupid SSH Tricks

I recently needed to backup a large directory's worth of data to another host over the network.?? You can pipe data into ssh via stdin, which will send it over the SSH channel to the remote side, and you can execute an arbitrary command or shell built-in on the remote side:
tar cvzf - /mydir | ssh myhost.com "cat > backup.tar.gz"

Published: April 24 2009

blog comments powered by Disqus