SYNCFFSD(8)

NAME
syncffsd - Replicate FFS filesystems using rsync

SYNOPSIS
syncffsd [-c command] [-d] [-f] [-n] [-p pidfile] [-u user] [-S statefile] [-T statedelay] -P source_prefix -s source -t host:target
syncffsd [-c command] [-d] [-f] [-n] [-p pidfile] [-P source_prefix] [-u user] [-S statefile] [-T statedelay] source host:target

DESCRIPTION
syncffsd uses rsync(1) to replicate a directory tree to another host. This involves detecting changes, something NetBSD is not well prepared to handle. The kqueue(2) interface can detect changes, but it needs to use a file descriptor for every node monitored, and this does not scales very well for huge directories trees.

syncffsd attempts to improve the situation until kqueue(2) gets better, by using FFS superblock's fs_time field, which is updated on every filesystem change. This lets syncffsd detects a change immediatly if the filesystem is mounted synchronous, or after a few seconds if mounted with WAPBL(4) enabled.

Once a change is detected, the relevant nodes are found by walking source looking for files that changed since the previous filesystem modification. The resulting nodes are deduped (i.e.: we do not retain a node in a directory if the directory itself changed), and are fed to rsync(1).

The following options are available:

-c command
    Supply the rsync command. By default this rsync -az --delete if running as superuser, and rsync -rlptz --delete otherwise.

-d  Enable debug messages.

-f  Foreground mode, do not become a daemon.

-n  Dry mode. Display the rsync(1) command that would be ran.

-p pidfile
    Path to file where syncffsd writes its PID.

-P source_prefix
    Change directory to source_prefix and only copy the files below to the target. This option is mandatory if using multiple sources.

-s source
    Specify a source directory. This option can be used multiple times, but all sources should be on the same filesystem.

-t host:target
    Specify a target. This option can be used multiple time to run multiple rsync(1) commands for multiple remote hosts.

-u user
    Switch to an unprivilegied user during operations.

-S statefile
    Specify a file where state should be dumped.

-T statedelay
    Specify how often state should be dumped. Use 0 to disable regular state dumps.

EXIT STATUS
The syncffsd utility exits 0 on success, and 0 if an error occurs.

SIGNALS
syncffsd will cleanly exit when receiving the following signals: SIGHUP, SIGQUIT, or SIGTERM. syncffsd will dump state (see -S option) when receiving SIGINFO.

ERRORS
The program logs to the syslog daemon as facility “daemon”. To enable debug output, use the -d option.

AUTHORS
The utility was written by Emmanuel Dreyfus <manu@NetBSD.org>.

SEE ALSO
rsync(1), fs(5).