On Wed, 16 January, 2008 5:49 pm, Mark Rogers wrote:
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.
Are you intending to backup an entire database? If so, why not dump, like this:
/usr/bin/mysqldump -all-databases -u root -ppassword > mydump.sql
I appreciate that doesn't fix your rsync permissions problem, but I was under the impression that's not a good way to backup MySQL.
Cheers.
-Mark
----------------------------------------------------------- This message may contain confidential and/or privileged information. This information is intended to be read only by the individual or entity to whom it is addressed. If you are not the intended recipient, you are on notice that any review, disclosure, copying, distribution or use of the contents of this message is strictly prohibited. If you have received this message in error, please notify the sender immediately and delete or destroy any copy of this message.