Jump to content

Obsolete:Rsync

From Wikitech
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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 = *

[mysql]
uid=mysql
gid=mysql
path = /usr/local/mysql/data
read only = yes
hosts allow = 207.142.131.192/26 127.0.0.1 10.0.0.0/8

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.