Can't get rsync over sftp to work
rsync doesn't do SFTP. From the man page:
There are two different ways for rsync to contact a remote system:
using a remote-shell program as the transport (such as ssh or rsh) or
contacting an rsync daemon directly via TCP.
SFTP doesn't give you a shell, ergo it doesn't work for rsync. You'll need an SSH connection instead.
Once you've allowed SSH connections, you may need to specifically tell rsync to use SSH. There are a few ways to do that:
rsync -aHvhiPb --rsh=ssh /var/www/ [email protected]:./
or
rsync -aHvhiPb "ssh -l ubuntu-backup" /var/www/ backup.example.com:./
There are a lot more examples in the man page for rsync.
In the second example, it's syncing the files into a directory named [email protected] located in the direct. In order to specify a remote server, you should use a colon somewhere in the specification.