Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to tryout Rsync for the first time but have run into difficulty.

I want to transfer files from a remote server to my local server.

I login to my local server and type:

sudo rsync -avz ssh /var/www/html/ /var/www/html/

Which means I want to to copy the folder '' from the remote server into the /var/www/html folder on my local server.

Both severs are configured to use the same ssh key.

I get the following errors:

sending incremental file list
rsync: link_stat "/var/www/html/ssh" failed: No such file or directory (2)
rsync: link_stat "/var/www/html/" failed: No such file or directory (2)

sent 55 bytes  received 13 bytes  136.00 bytes/sec
total size is 0  speedup is 0.00
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1070) [sender=3.0.9]

Can anybody help me understand these errors?

Thanks in advance!

share|improve this question
Try -e "ssh ubuntu@a.b.c.d" instead of just ssh ubuntu@a.b.c.d. – MadHatter Jan 30 '14 at 10:14
Thats worked! But now I get the error: Permission denied (publickey). – Bob Flemming Jan 30 '14 at 10:24
Then I submit that you don't, in fact, have working keys. – MadHatter Jan 30 '14 at 16:23

Your syntax is incorrect. Should be

sudo rsync -avz -e ssh /var/www/html/

Missing the -e operator for ssh. And you need colon after the ip address.

share|improve this answer

When specifying a remote location with SSH (which require -e ssh, otherwise it uses rsync own protocol and requires rsync server/daemon to be started on the other end), you have to write it following this pattern :


If you ommit user@ it willl assume the remote user is the same that the one used on the local machine If you ommit .domain it will use your domain search settings (like any other name resolution) If you omit path it will use the remote user's home directory (Note: it's the same as writing user@server:~ )

So here, you just have to replace the space by a colon : like Grumpy wrote it in his answer.

share|improve this answer
Thats worked! But now I get the error: Permission denied (publickey). – Bob Flemming Jan 30 '14 at 10:44

try below syntax

rsync -e ssh -avz root@

Also you can include ssh key & port if required

rsync -e "ssh -p PORT_NO -i path_to_file" -avz
share|improve this answer
You might want to remove your IP from your answer... – Grumpy Feb 1 '14 at 13:26

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.