I need to transfer some files via rsync and can´t tar them before. So I thought maybe there is a mode which checks the folders content and if it is thousand of small files inside compress that folder for the transfer. However I couldn´t find something like that in the man (http://www.manpagez.com/man/1/rsync/). Is it possible and I didn´t find it or would I have to do this before I use rsync?
You'll typically use one of the following methods when you need to push or pull files over SSH using
Copy SOURCEDIR from localhost to remotehost
Conceptually I'll often refer to this as pushing files, since we're taking the output of a
tar command and we're pushing the files to another system over SSH. The files are targeted for copying on the remote system into
$ tar zcvf - SOURCEDIR | ssh user1@remotehost 'cd DESTDIR; tar zxvf - '
$ tar zcvf - SOURCEDIR | ssh user1@remotehost "(cd DESTDIR; tar zxvf -)"
$ tar zcvf - SOURCEDIR | ssh -l user1 remotehost 'cd DESTDIR ; tar zxvf -'
Copy SOURCEDIR from remotehost to localhost
Conceptually I'll often refer to this as pulling files, since we're making an SSH connection to a remote host, where we're kicking off a
tar command. The output of this
tar command is then targeted for copying on the local system into
$ ssh remotehost 'tar zcvf - SOURCEDIR' | tar zxvf -
$ ssh -n remotehost 'tar zcvf - SOURCEDIR' | tar zxvf -
$ ssh remotehost "( cd SOURCEDIR ; tar zcvf - SOURCEFILES ) " | tar zxvf -