Why using SSH to transfer data when you can use SCP/SFTP ?
Because sometime SCP is disable in SSH configuration.
So here is an easy way to transfert data with ssh. Run something like this
ssh -C <host> "cd /path/to/folder/to/transfer; tar cvf - *" | tar xfv
-C will compress tranfer using gzip, I didn’t do any test to see if it’s better to use -C to compress on the SSH level or to use tar cvzf to compress the tar file. If you do please give me result !
“| tar xvf” will extract file in your current directory, of course, you may want to leave them in the .tar file.