TIL

Streaming a tarball over SSH

Need to archive a directory, but don't have enough disk space to hold the directory and the tarball? Create the tarball and stream it over SSH to another machine.

tar cvzf - your_directory | ssh user@server 'cat - > /path/to/backup/archive.tar.gz'