[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.4

1.4     ! florian     1: .\"    $OpenBSD: rsync.1,v 1.3 2019/02/12 19:16:41 benno 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.4     ! florian    17: .Dd $Mdocdate: February 12 2019 $
1.1       benno      18: .Dt RSYNC 1
                     19: .Os
                     20: .Sh NAME
                     21: .Nm rsync
                     22: .Nd synchronise local and remote files
                     23: .Sh SYNOPSIS
                     24: .Nm rsync
1.4     ! florian    25: .Op Fl glnoprtv
1.1       benno      26: .Op Fl -delete
                     27: .Op Fl -rsync-path Ar prog
                     28: .Ar source ...
                     29: .Ar directory
                     30: .Sh DESCRIPTION
                     31: The
                     32: .Nm
                     33: utility synchronises files in the destination
                     34: .Ar directory
                     35: with one or more
                     36: .Ar source
                     37: files.
                     38: Either the
                     39: .Ar source
                     40: or the destination
                     41: .Ar directory
                     42: may be remote,
                     43: but not both.
                     44: The arguments are as follows:
                     45: .Bl -tag -width Ds
1.3       benno      46: .It Fl g
                     47: Set group identifier to match the source.
                     48: Groups are matched by name: group
                     49: .Qq kristaps
                     50: with id 1000 on a remote server will be properly assigned group
                     51: .Qq kristaps
                     52: on the local machine with id 2000.
                     53: If the sender's group is unknown on the local machine, it is used
                     54: verbatim.
1.1       benno      55: .It Fl l
                     56: Transfer symbolic links.
                     57: The link is transferred as a standalone file: if the destination does
                     58: not exist, it will be broken.
                     59: .It Fl n
                     60: Dry-run mode.
                     61: Does not actually modify the destination.
1.4     ! florian    62: .It Fl o
        !            63: Set user identifier to match the source.
        !            64: This behaves like
        !            65: .Fl g
        !            66: and only works if run as root.
1.1       benno      67: .It Fl p
                     68: Set destination file or directory permissions to match the source when
                     69: it is updated.
                     70: .It Fl r
                     71: If
                     72: .Ar source
                     73: designates a directory, synchronise the directory and the entire subtree
                     74: connected at that point.
                     75: If
                     76: .Ar source
                     77: ends with a slash, only the subtree is synchronised, not the root
                     78: directory.
                     79: If
                     80: .Ar source
                     81: is a file, this has no effect.
                     82: .It Fl t
                     83: Set destination file and directory modification time to match the source
                     84: when it is updated or created.
                     85: .It Fl v
                     86: Increase verbosity.
                     87: Specify once for files being transferred, twice for specific status,
                     88: thrice for per-file transfer information, and four times for per-file
                     89: breakdowns.
                     90: .It Fl -delete
                     91: Delete files in
                     92: .Ar directory
                     93: not found in
                     94: .Ar source
                     95: directories.
                     96: Only applicable with
                     97: .Fl r .
                     98: .It Fl -rsync-path Ar prog
                     99: Run
                    100: .Ar prog
                    101: on the remote host instead of the default
                    102: .Ar rsync .
                    103: .El
                    104: .Pp
                    105: A remote
                    106: .Ar source
                    107: or
                    108: .Ar directory
                    109: has syntax
                    110: .Ar host:path
                    111: for connecting via
                    112: .Xr ssh 1 ,
                    113: or
                    114: .Ar rsync://host/path
                    115: or
                    116: .Ar host::path
                    117: for connecting to a remote daemon.
                    118: Subsequent to the first remote
                    119: .Ar source ,
                    120: the host may be dropped to become just
                    121: .Ar :path
                    122: or
                    123: .Ar ::path .
                    124: .Pp
                    125: For connecting to a remote daemon with
                    126: .Ar rsync://host
                    127: or
                    128: .Ar host::path ,
                    129: the first path component is interpreted as a
                    130: .Qq module :
                    131: .Ar host::module/path .
                    132: This only applies to the first
                    133: .Ar source
                    134: invocation; subsequent to that, the module should not be specified.
                    135: .Pp
                    136: By default, new destination files and directories are given the current
                    137: time and the source file permissions.
                    138: Updated files retain their existing permissions.
                    139: It is an error if updated files have their file types change (e.g.,
                    140: updating a directory with a file).
                    141: .Pp
                    142: At this time,
                    143: .Ar source
                    144: may only consist of regular files, directories
                    145: .Pq only with Fl r ,
                    146: or symbolic links
                    147: .Pq only with Fl l .
                    148: The destination
                    149: .Ar directory
                    150: must be a directory and is created if not found.
                    151: .Pp
                    152: .Nm
                    153: is compatible with the GPL-licensed
                    154: .Xr rsync 1
                    155: protocol version 27.
                    156: .\" The following requests should be uncommented and used where appropriate.
                    157: .\" .Sh CONTEXT
                    158: .\" For section 9 functions only.
                    159: .\" .Sh RETURN VALUES
                    160: .\" For sections 2, 3, and 9 function return values only.
                    161: .\" .Sh ENVIRONMENT
                    162: .\" For sections 1, 6, 7, and 8 only.
                    163: .\" .Sh FILES
                    164: .\" .Sh EXIT STATUS
                    165: .\" For sections 1, 6, and 8 only.
                    166: .Sh EXAMPLES
                    167: All examples use
                    168: .Fl t
                    169: so that destination files inherit the source time.
                    170: If not changed, subsequent invocations of
                    171: .Nm
                    172: will then consider the file up to date and not transfer block hashes.
                    173: .Pp
                    174: To update the out-of-date remote files
                    175: .Pa host:dest/bar
                    176: and
                    177: .Pa host:dest/baz
                    178: with the local
                    179: .Pa ../src/bar
                    180: and
                    181: .Pa ../src/baz :
                    182: .Pp
                    183: .Dl % rsync -t ../src/bar ../src/baz host:dest
                    184: .Pp
                    185: To update the out-of-date local files
                    186: .Pa bar
                    187: and
                    188: .Pa baz
                    189: with the remote files
                    190: .Pa host:src/bar
                    191: and
                    192: .Pa host:src/baz :
                    193: .Pp
                    194: .Dl % rsync -t host:src/bar :src/baz \&.
                    195: .Pp
                    196: To update the out-of-date local files
                    197: .Pa ../dest/bar
                    198: and
                    199: .Pa ../dest/baz
                    200: with
                    201: .Pa bar
                    202: and
                    203: .Pa baz :
                    204: .Pp
                    205: .Dl % rsync -t bar baz ../dest
                    206: .Pp
                    207: To update the out-of-date remote files in
                    208: .Pa host:dest
                    209: on a remote host running
                    210: .Nm
                    211: with the local host running
                    212: .Xr rsync 1 :
                    213: .Pp
                    214: .Dl % rsync --rsync-path rsync -t ../dest/* host:dest
                    215: .\" .Sh DIAGNOSTICS
                    216: .\" For sections 1, 4, 6, 7, 8, and 9 printf/stderr messages only.
                    217: .\" .Sh ERRORS
                    218: .\" For sections 2, 3, 4, and 9 errno settings only.
                    219: .Sh SEE ALSO
                    220: .Xr ssh 1 ,
                    221: .Xr rsync 5 ,
                    222: .Xr rsyncd 5
                    223: .\" .Sh STANDARDS
                    224: .\" .Sh HISTORY
                    225: .\" .Sh AUTHORS
                    226: .\" .Sh CAVEATS
                    227: .\" .Sh BUGS