I want to use file transfer via SSH on some scripts. I've read it's possible to tar over ssh. Where should I start reading?
To do file transfer over ssh you can
- use scp
scp -r /srcdir/ user@remotehost:/destdir/
- use rsync over ssh (see the -e parameter)
rsync -e ssh -a /srcdir/ user@remotehost:/destdir/
- use some tool that transfers data via stdin/out (tar, cpio, etc)
cd /sourcedir; tar -c . | ssh username@remotehost bash 'cd /dstdir; tar -x
- Mount the filesystem via sshfs (if fuse is supported on your system)
O'Reilly has a book with it all - SSH, The Secure Shell: The Definitive Guide - if you Google for it, there are many references, places to buy it, and view it online.
Im no expert, but I think http://en.wikipedia.org/wiki/Secure_copy is what you want.
For tar over ssh, you can use the fact the ssh forwards stdin and stdout. So you can do
ssh server 'tar czf - /some/dir/' > tarfile.tar.gz
and have the backup on the local machine.