I can haz opinion?

nkpart at gmail dot com
Feb 28
Permalink

More SSH goodness - piping data

$ echo hello | ssh remote.server "cat > file"

$ ssh remote.server "cat file"

hello

Cool, non? Our practical use for this was using 7zip to compress a large data file (several gigs of csv basically) locally and have it be streamed up to a server on EC2, rather than compressing the entire file then scp’ing the result up.

$ 7z a dummy -so -tgzip big_huge_data.csv | ssh remote.server "cat > big_huge_data.csv.7z"

The only problem is that you *must* specify gzip compression (or at least not use 7zips default compression algorithm).