OPENRSYNC(1) | General Commands Manual | OPENRSYNC(1) |
openrsync
—
synchronise local and remote files
openrsync |
[-aDglnoprtvx ] [-e
program]
[--address =sourceaddr]
[--compare-dest =directory]
[--del ] [--exclude
pattern]
[--exclude-from =file]
[--include pattern]
[--include-from =file]
[--max-size =size]
[--min-size =size]
[--no-motd ]
[--numeric-ids ]
[--port =service]
[--rsync-path =program]
[--timeout =seconds]
[--version ] source ...
directory |
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:
-a
,
--archive
-Dgloprt
.--address
=sourceaddr--compare-dest
=directory--compare-dest
directories
may be provided. If directory is a relative path, it
is relative to the destination directory.-D
--devices
--specials
.--del
,
--delete
-r
.--exclude
pattern--exclude-from
=file--include
pattern--include-from
=file--devices
-e
program,
--rsh
=program-g
,
--group
--numeric-ids
is also given or if the remote group
name is unknown on the local machine, set the numeric group ID to match
the source instead.-l
,
--links
--max-size
size--min-size
size--max-size
on the definition of
size.-n
,
--dry-run
-v
.--no-motd
--numeric-ids
-g
or -o
is
also given.-o
,
--owner
-g
. If --numeric-ids
is
also given or if the remote user name is unknown on the local machine, set
the numeric user ID to match the source instead. Only works if run as
root.-p
,
--perms
--port
=service-r
,
--recursive
--rsync-path
=program--specials
--timeout
=seconds-t
,
--times
-v
,
--verbose
-x
--version
A remote source or
directory has the syntax
host:path for connecting via
ssh(1), or
rsync
://host/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).
At this time, source may only consist of
regular files, directories (only with -r
), or
symbolic links (only with -l
). The destination
directory must be a directory and is created if not
found.
The openrsync
utility exits 0 on success,
1 if an error occurs, or 2 if the remote protocol version is older than the
local protocol version.
All examples use -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:
% rsync -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:
% rsync -t host:src/bar :src/baz
.
To update the out-of-date local files ../dest/bar and ../dest/baz with bar and baz:
% rsync -t bar baz
../dest
openrsync
is compatible with rsync
protocol version 27 as supported by the samba.org implementation of
rsync.
The openrsync
utility has been available
since OpenBSD 6.5.
The openrsync
utility was written by
Kristaps Dzonsons
<kristaps@bsd.lv>.
November 26, 2021 | OpenBSD-current |