Ubuntu – Cant understand Rsync errors using ssh

rsyncsshUbuntu

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 ubuntu@xx.xxx.xx.xx /var/www/html/mywebsite.co.uk /var/www/html/

Which means I want to to copy the folder 'mywebsite.co.uk' 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/ubuntu@xx.xxx.xxx.xx" 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!

Best Answer

Your syntax is incorrect. Should be

sudo rsync -avz -e ssh ubuntu@xx.xxx.xx.xx:/var/www/html/mywebsite.co.uk /var/www/html/

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