5.34. Rsync Basics

Install rsync (/usr/ports/net/rsync).

Edit the /usr/local/etc/rsyncd.conf configuration file. For example:

    pid file = /var/run/rsyncd.pid

    uid = nobody
    gid = nobody
    use chroot = no
    max connections = 4

    [elapsed_time]
            path=/home/rpratt/public_html/c_snippets/elapsed_time
            comment = Convert elapsed seconds to dd:hh:mm:ss output

In order to have rsyncd start on boot, add this entry to /etc/rc.conf:

rsyncd_enable="YES"

To start rysncd without rebooting:

# rsync --daemon

To list all the modules on a rsync host:

# rsync myfreebsd.homeunix.net::

To list files in a module:

# rsync -avz --delete myfreebsd.homeunix.net::elapsed_time

To retrieve remote files and place them in a local directory:

# rsync -avz --delete myfreebsd.homeunix.net::elapsed_time ./foo/

See http://www.freeos.com/articles/4042/ for more information.