[BACK]Return to rsync.1 CVS log [TXT][DIR] Up to [local] / src / usr.bin / rsync

Annotation of src/usr.bin/rsync/rsync.1, Revision 1.19

1.19    ! claudio     1: .\"    $OpenBSD: rsync.1,v 1.18 2019/05/06 15:44:34 schwarze Exp $
1.1       benno       2: .\"
                      3: .\" Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
                      4: .\"
                      5: .\" Permission to use, copy, modify, and distribute this software for any
                      6: .\" purpose with or without fee is hereby granted, provided that the above
                      7: .\" copyright notice and this permission notice appear in all copies.
                      8: .\"
                      9: .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                     10: .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                     11: .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                     12: .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                     13: .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                     14: .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                     15: .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                     16: .\"
1.19    ! claudio    17: .Dd $Mdocdate: May 6 2019 $
1.12      schwarze   18: .Dt OPENRSYNC 1
1.1       benno      19: .Os
                     20: .Sh NAME
1.11      jmc        21: .Nm openrsync
1.1       benno      22: .Nd synchronise local and remote files
                     23: .Sh SYNOPSIS
1.12      schwarze   24: .Nm openrsync
1.17      bket       25: .Op Fl aDglnoprtvx
1.10      jmc        26: .Op Fl e Ar program
1.19    ! claudio    27: .Op Fl -address Ns = Ns Ar bind_address
1.13      naddy      28: .Op Fl -del
1.16      schwarze   29: .Op Fl -numeric-ids
                     30: .Op Fl -port Ns = Ns Ar service
1.10      jmc        31: .Op Fl -rsync-path Ns = Ns Ar program
                     32: .Op Fl -version
1.1       benno      33: .Ar source ...
                     34: .Ar directory
                     35: .Sh DESCRIPTION
                     36: The
                     37: .Nm
                     38: utility synchronises files in the destination
                     39: .Ar directory
                     40: with one or more
                     41: .Ar source
                     42: files.
                     43: Either the
                     44: .Ar source
                     45: or the destination
                     46: .Ar directory
                     47: may be remote,
                     48: but not both.
                     49: The arguments are as follows:
                     50: .Bl -tag -width Ds
1.14      schwarze   51: .It Fl a , -archive
1.6       florian    52: Shorthand for
1.10      jmc        53: .Fl Dgloprt .
1.19    ! claudio    54: .It Fl -address Ns = Ns Ar bind_address
        !            55: Use
        !            56: .Ar bind_address
        !            57: on the local machine as the source address of the connection.
        !            58: Only useful when connecting to an rsync daemon and on systems with more than
        !            59: one address.
1.6       florian    60: .It Fl D
1.16      schwarze   61: Also transfer device and special files.
1.6       florian    62: Shorthand for
1.16      schwarze   63: .Fl -devices -specials .
1.13      naddy      64: .It Fl -del , -delete
1.10      jmc        65: Delete files in
                     66: .Ar directory
                     67: not found in
                     68: .Ar source
                     69: directories.
                     70: Only applicable with
                     71: .Fl r .
1.6       florian    72: .It Fl -devices
1.16      schwarze   73: Also transfer device files.
1.10      jmc        74: .It Fl e Ar program , Fl -rsh Ns = Ns Ar program
1.16      schwarze   75: Specify alternative communication program, defaults to
1.8       deraadt    76: .Xr ssh 1 .
1.14      schwarze   77: .It Fl g , -group
1.16      schwarze   78: Set the group name to match the source.
                     79: For example, group
1.3       benno      80: .Qq kristaps
1.16      schwarze   81: with ID 1000 on a remote server is matched to group
1.3       benno      82: .Qq kristaps
1.16      schwarze   83: on the local machine with ID 2000.
                     84: If
                     85: .Fl -numeric-ids
                     86: is also given or if the remote group name is unknown on the local machine,
                     87: set the numeric group ID to match the source instead.
1.14      schwarze   88: .It Fl l , -links
1.16      schwarze   89: Also transfer symbolic links.
1.1       benno      90: The link is transferred as a standalone file: if the destination does
                     91: not exist, it will be broken.
1.14      schwarze   92: .It Fl n , -dry-run
1.16      schwarze   93: Do not actually modify the destination.
                     94: Mainly useful in combination with
                     95: .Fl v .
                     96: .It Fl -numeric-ids
                     97: Ignore user and group names, use numeric user and group IDs only.
                     98: Has no effect unless
                     99: .Fl g
                    100: or
                    101: .Fl o
                    102: is also given.
1.14      schwarze  103: .It Fl o , -owner
1.16      schwarze  104: Set the user name to match the source, with similar matching logic as for
                    105: .Fl g .
                    106: If
                    107: .Fl -numeric-ids
                    108: is also given or if the remote user name is unknown on the local machine,
                    109: set the numeric user ID to match the source instead.
                    110: Only works if run as root.
1.14      schwarze  111: .It Fl p , -perms
1.1       benno     112: Set destination file or directory permissions to match the source when
                    113: it is updated.
1.16      schwarze  114: .It Fl -port Ns = Ns Ar service
                    115: Specify an alternative TCP port number.
                    116: The
                    117: .Ar service
                    118: can be given as a decimal integer or as a name to be looked up in the
                    119: .Xr services 5
                    120: database.
                    121: The default is
                    122: .Dq rsync .
1.14      schwarze  123: .It Fl r , -recursive
1.1       benno     124: If
                    125: .Ar source
                    126: designates a directory, synchronise the directory and the entire subtree
                    127: connected at that point.
                    128: If
                    129: .Ar source
1.16      schwarze  130: ends with a slash, only the subtree is synchronised, not the
                    131: .Ar source
                    132: directory itself.
1.1       benno     133: If
                    134: .Ar source
                    135: is a file, this has no effect.
1.10      jmc       136: .It Fl -rsync-path Ns = Ns Ar program
                    137: Run
1.16      schwarze  138: .Ar program
1.10      jmc       139: on the remote host instead of the default
1.16      schwarze  140: .Pa rsync .
1.6       florian   141: .It Fl -specials
1.16      schwarze  142: Also transfer fifo and unix domain socket files.
1.14      schwarze  143: .It Fl t , -times
1.1       benno     144: Set destination file and directory modification time to match the source
                    145: when it is updated or created.
1.14      schwarze  146: .It Fl v , -verbose
1.1       benno     147: Increase verbosity.
                    148: Specify once for files being transferred, twice for specific status,
                    149: thrice for per-file transfer information, and four times for per-file
                    150: breakdowns.
1.17      bket      151: .It Fl x
                    152: Do not cross filesystem boundaries.
                    153: If this option is repeated, all mount point directories from the copy are
                    154: omitted.
                    155: Otherwise, it includes an empty directory at each mount point it encounters.
1.5       deraadt   156: .It Fl -version
                    157: Print version and exit.
1.1       benno     158: .El
                    159: .Pp
                    160: A remote
                    161: .Ar source
                    162: or
                    163: .Ar directory
1.16      schwarze  164: has the syntax
                    165: .Ar host : Ns Ar path
1.1       benno     166: for connecting via
                    167: .Xr ssh 1 ,
                    168: or
1.16      schwarze  169: .Cm rsync Ns :// Ns Ar host Ns / Ns Ar path
1.1       benno     170: or
1.16      schwarze  171: .Ar host Ns :: Ns Ar path
1.1       benno     172: for connecting to a remote daemon.
                    173: Subsequent to the first remote
                    174: .Ar source ,
                    175: the host may be dropped to become just
1.16      schwarze  176: .Pf : Ar path
1.1       benno     177: or
1.16      schwarze  178: .Pf :: Ar path .
1.1       benno     179: .Pp
                    180: For connecting to a remote daemon with
1.16      schwarze  181: .Cm rsync Ns :// Ns Ar host
1.1       benno     182: or
1.16      schwarze  183: .Ar host Ns :: Ns Ar path ,
1.1       benno     184: the first path component is interpreted as a
                    185: .Qq module :
1.16      schwarze  186: .Ar host Ns :: Ns Ar module Ns / Ns Ar path .
1.1       benno     187: This only applies to the first
                    188: .Ar source
                    189: invocation; subsequent to that, the module should not be specified.
                    190: .Pp
                    191: By default, new destination files and directories are given the current
                    192: time and the source file permissions.
                    193: Updated files retain their existing permissions.
                    194: It is an error if updated files have their file types change (e.g.,
                    195: updating a directory with a file).
                    196: .Pp
                    197: At this time,
                    198: .Ar source
                    199: may only consist of regular files, directories
                    200: .Pq only with Fl r ,
                    201: or symbolic links
                    202: .Pq only with Fl l .
                    203: The destination
                    204: .Ar directory
                    205: must be a directory and is created if not found.
                    206: .\" .Sh ENVIRONMENT
                    207: .\" .Sh FILES
1.16      schwarze  208: .Sh EXIT STATUS
                    209: The
                    210: .Nm
                    211: utility exits 0 on success, 1 if an error occurs, or 2 if the remote
                    212: protocol version is older than the local protocol version.
1.1       benno     213: .Sh EXAMPLES
                    214: All examples use
                    215: .Fl t
                    216: so that destination files inherit the source time.
                    217: If not changed, subsequent invocations of
                    218: .Nm
                    219: will then consider the file up to date and not transfer block hashes.
                    220: .Pp
                    221: To update the out-of-date remote files
                    222: .Pa host:dest/bar
                    223: and
                    224: .Pa host:dest/baz
                    225: with the local
                    226: .Pa ../src/bar
                    227: and
                    228: .Pa ../src/baz :
                    229: .Pp
                    230: .Dl % rsync -t ../src/bar ../src/baz host:dest
                    231: .Pp
                    232: To update the out-of-date local files
                    233: .Pa bar
                    234: and
                    235: .Pa baz
                    236: with the remote files
                    237: .Pa host:src/bar
                    238: and
                    239: .Pa host:src/baz :
                    240: .Pp
                    241: .Dl % rsync -t host:src/bar :src/baz \&.
                    242: .Pp
                    243: To update the out-of-date local files
                    244: .Pa ../dest/bar
                    245: and
                    246: .Pa ../dest/baz
                    247: with
                    248: .Pa bar
                    249: and
                    250: .Pa baz :
                    251: .Pp
                    252: .Dl % rsync -t bar baz ../dest
                    253: .\" .Sh DIAGNOSTICS
                    254: .Sh SEE ALSO
                    255: .Xr ssh 1 ,
                    256: .Xr rsync 5 ,
                    257: .Xr rsyncd 5
1.16      schwarze  258: .Sh STANDARDS
                    259: .Nm
                    260: is compatible with rsync protocol version 27
                    261: as supported by the samba.org implementation of rsync.
                    262: .Sh HISTORY
                    263: The
                    264: .Nm
                    265: utility has been available since
                    266: .Ox 6.5 .
                    267: .Sh AUTHORS
                    268: The
                    269: .Nm
                    270: utility was written by
                    271: .An Kristaps Dzonsons Aq Mt kristaps@bsd.lv .
1.1       benno     272: .\" .Sh CAVEATS
                    273: .\" .Sh BUGS