Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am trying to use Rsync to transfer files between two servers. Rsync builds the incremental file list, but doesn't transfer anything. I am using Ubuntu Server on both machines. I am using the following command:

sudo rsync -avz -e "ssh -p $222" user@remoteip:/var/wwws/ /var/wwws/

For some reason I have to set set the port as 222, in the command, to get it to use 22. I was using a different port on one of the servers. I changed it back to 22, but I still have to add the port into the command to get it to connect. My config file is set up as follows on the server:

motd file = /etc/rsyncd.motd

path = /var/wwws
comment = This is the path to my Eclipse workspace (on the server)
uid = username
gid = username
read only = false
auth users = username
secrets file = /etc/rsyncd.scrt

On the first attempt, it runs through a list of the files to be transfered, but doesn't transfer anything. In subsequent attempts, it seems to just assume that everything is done. I'm thinking the command might be worded wrong and it is just doing a test run, or possibly it is a permissions issue. Any help would be greatly appreciated.

share|improve this question
What happens if you remove the -p $222? the $ makes me think its an environmental variable. What happens if you ssh to user@remoteip? –  becomingwisest Dec 23 '11 at 23:14
What happens if you remove the -e "ssh -p $222" ? –  Bill Weiss Dec 23 '11 at 23:17
If I remove that, it won't connect. As I mentioned briefly, one of my servers was on a nonstandard port. I changed it back to 22, but if I SSH with Rsync, it says that it can't connect and displays the previous port. I know that the port has changed back to 22, because I can SSH into the server on port 22. –  Arthur Dec 23 '11 at 23:37
Why are you trying to force the -e anyway? I've never needed to do that under Ubuntu as it defaults to SSH in a stock install anyway. What output/errors when you simply run: sudo rsync -avz user@remoteip:/var/wwws/ /var/wwws/ –  Magellan Dec 23 '11 at 23:38
It won't connect if I use the following: sudo rsync -avz user@remoteip:/var/wwws/ /var/wwws/. I used to have SSH on a nonstandard port. It displays the old port and tells me that it can't connect. It seems to be trying to connect to the old port. I think that might be the problem. Any suggestions? –  Arthur Dec 23 '11 at 23:44

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.