OPENRSYNC(1)

NAME
openrsync - synchronise local and remote files

SYNOPSIS
openrsync [-Daglnoprtv] [-e prog] [--delete] [--numeric-ids] [--port port] [--rsync-path prog] source ... directory

DESCRIPTION
The openrsync utility synchronises files in the destination directory with one or more source files. Either the source or the destination directory may be remote, but not both. The arguments are as follows:

-D  Transfer FIFOs, device special files, and sockets.

-a  Shorthand for -Dgloptr.

-g  Set group identifier to match the source. Groups are matched by name: group "kristaps" with id 1000 on a remote server will be properly assigned group "kristaps" on the local machine with id 2000. If the sender's group is unknown on the local machine, the numerical value is used.

-l  Transfer symbolic links. The link is transferred as a standalone file: if the destination does not exist, it will be broken.

-n  Dry-run mode. Does not actually modify the destination.

-o  Set user identifier to match the source. This behaves like -g and only works if run as root.

-p  Set destination file or directory permissions to match the source when it is updated.

-r  If source designates a directory, synchronise the directory and the entire subtree connected at that point. If source ends with a slash, only the subtree is synchronised, not the root directory. If source is a file, this has no effect.

-t  Set destination file and directory modification time to match the source when it is updated or created.

-v  Increase verbosity. Specify once for files being transferred, twice for specific status, thrice for per-file transfer information, and four times for per-file breakdowns.

-e prog
    The remote shell command to use. This may consist of space-separated command and arguments, such as "ssh -l kristaps".

--delete
    Delete files in directory not found in source directories. Only applicable with -r.

--numeric-ids
    With -g or -o, simply use the numeric identifier and do not map by name.

--port port
    Specify a default port for connecting to "rsync://" servers. This is overridden by any port specified in the URL.

--rsync-path prog
    Run prog on the remote host instead of the default rsync.

By default openrsync connects to remote hosts using ssh(1) and passes the arguments to rsync(1). The destination directory must be a directory and is created if not found.

A remote source or directory has syntax host:path for connecting via ssh(1), or rsync://host[:port]/path or host::path for connecting to a remote daemon. Subsequent to the first remote source, the host may be dropped to become just :path or ::path.

For connecting to a remote daemon with rsync://host or host::path, the first path component is interpreted as a "module": host::module/path. This only applies to the first source invocation; subsequent to that, the module should not be specified.

By default, new destination files and directories are given the current time and the source file permissions. Updated files retain their existing permissions. It is an error if updated files have their file types change (e.g., updating a directory with a file).

openrsync is compatible with the GPL-licensed rsync(1) protocol version 27.

EXAMPLES
A common invocation of openrsync is for archiving from a remote host to the local computer:

    % openrsync -av --delete remote:rpath /local/path

This will update the contents of /local/path/rpath with those on the remote server. Switching remote and local wil update the remote contents instead:

    % openrsync -av --delete /local/path remote:rpath

All subsequent examples use only -t so that destination files inherit the source time. If not changed, subsequent invocations of openrsync will then consider the file up to date and not transfer block hashes.

To update the out-of-date remote files host:dest/bar and host:dest/baz with the local ../src/bar and ../src/baz:

    % openrsync -t ../src/bar ../src/baz host:dest

To update the out-of-date local files bar and baz with the remote files host:src/bar and host:src/baz:

    % openrsync -t host:src/bar :src/baz.

To update the out-of-date local files ../dest/bar and ../dest/baz with bar and baz:

    % openrsync -t bar baz ../dest

To update the out-of-date remote files in host:dest on a remote host running openrsync with the local host running rsync(1):

    % rsync --rsync-path openrsync -t ../dest/* host:dest

SEE ALSO
ssh(1), rsync(5), rsyncd(5)