From Wikitech
Jump to navigation Jump to search

man pages

See the man pages for rsync and rsyncd.conf.

Example for transferring MySQL data directory

On the source machine:

Set up rsync to serve the MySQL data directory, by editing /etc/rsyncd.conf:

# Don't bother compressing anything.
dont compress = *

path = /usr/local/mysql/data
read only = yes
hosts allow =

Make sure rsync is running as a daemon:

[root@bacon root]# ps ax | grep rsync.*daemon
 3652 ?        S      0:00 rsync --daemon

If not, start it like so:

[root@bacon root]# rsync --daemon

On the destination machine:

rsync --whole-file --progress --stats --verbose --archive \
  --delete --delete-excluded \
  suda::mysql /usr/local/mysql/data

where suda is the source machine and /usr/local/mysql/data is the destination directory.