Do you need -e ssh for rsync

backuprsync

I always used to use the following command when copying from a server:

rsync --progress -avze ssh user@host:/path/to/files ./here

However, a friend of mine showed me that I can simply do:

rsync --progress -avz user@host:/path/to/files ./here

So the question is, if you do not need -e ssh why is it there anyways?

Best Answer

Any time you need additional options to the ssh command outside of the user and host, then you need the -e flag. Perhaps the server you're connecting to has ssh listening on port 2222.

rsync -e 'ssh -p 2222' /source usr@host:/dest

An alternative to getting around this, there are 2 files you can use. /etc/ssh/ssh_config or ~/.ssh/config

The config file uses the same format as ssh_config. It's just able to be configured on a per user basis!