Consider: rsync -avz user@host:/var/lib/mysql /var/lib/mysql
Assuming the files I want to transfer are owned by mysql (both locally and remotely), and are not world-readable, how do I achieve this?
I can use sudo at the local end: sudo rsync -avz user@host:/var/lib/mysql /var/lib/mysql .. to give me the necessary write access to /var/lib/locally, but how do I give rsync read access to the files at the remote host? The mysql user does not have login rights and therefore does not have a password, so I can't just use mysql@host, and there is no root user at the remote host either; if I wanted read access at that end I'd use sudo to get it.
Local end is Ubuntu, remote host is FC4, if that's relevant.