logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

rsync.1 (8869B)


  1. .\" $OpenBSD: rsync.1,v 1.35 2023/11/27 11:32:34 claudio Exp $
  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. .\"
  17. .Dd $Mdocdate: November 27 2023 $
  18. .Dt OPENRSYNC 1
  19. .Os
  20. .Sh NAME
  21. .Nm openrsync
  22. .Nd synchronise local and remote files
  23. .Sh SYNOPSIS
  24. .Nm openrsync
  25. .Op Fl aDgIJlnOoprtVvx
  26. .Op Fl e Ar program
  27. .Op Fl -address Ns = Ns Ar sourceaddr
  28. .Op Fl -compare-dest Ns = Ns Ar directory
  29. .Op Fl -contimeout Ns = Ns Ar seconds
  30. .Op Fl -del
  31. .Op Fl -exclude Ar pattern
  32. .Op Fl -exclude-from Ns = Ns Ar file
  33. .Op Fl -include Ar pattern
  34. .Op Fl -include-from Ns = Ns Ar file
  35. .Op Fl -max-size Ns = Ns size
  36. .Op Fl -min-size Ns = Ns size
  37. .Op Fl -no-motd
  38. .Op Fl -numeric-ids
  39. .Op Fl -port Ns = Ns Ar service
  40. .Op Fl -rsync-path Ns = Ns Ar program
  41. .Op Fl -size-only
  42. .Op Fl -timeout Ns = Ns Ar seconds
  43. .Ar source ...
  44. .Ar directory
  45. .Sh DESCRIPTION
  46. The
  47. .Nm
  48. utility synchronises files in the destination
  49. .Ar directory
  50. with one or more
  51. .Ar source
  52. files.
  53. Either the
  54. .Ar source
  55. or the destination
  56. .Ar directory
  57. may be remote,
  58. but not both.
  59. The arguments are as follows:
  60. .Bl -tag -width Ds
  61. .It Fl a , -archive
  62. Shorthand for
  63. .Fl Dgloprt .
  64. .It Fl -address Ns = Ns Ar sourceaddr
  65. When connecting to an rsync daemon, use
  66. .Ar sourceaddr
  67. as the source address for connections, which is useful on machines with
  68. multiple interfaces.
  69. .It Fl -compare-dest Ns = Ns Ar directory
  70. Use directory as an alternate base directory to compare files against on the
  71. destination machine.
  72. If file in
  73. .Ar directory
  74. is found and identical to the sender's file, the file will not be transferred.
  75. Multiple
  76. .Fl -compare-dest
  77. directories may be provided.
  78. If
  79. .Ar directory
  80. is a relative path, it is relative to the destination directory.
  81. .It Fl -contimeout Ns = Ns Ar seconds
  82. Set the connection timeout in seconds.
  83. Exit if no connection established within the specified time.
  84. The default is 0, which means no timeout.
  85. .It Fl D
  86. Also transfer device and special files.
  87. Shorthand for
  88. .Fl -devices -specials .
  89. .It Fl -del , -delete
  90. Delete files in
  91. .Ar directory
  92. not found in
  93. .Ar source
  94. directories.
  95. Only applicable with
  96. .Fl r .
  97. .It Fl e Ar program , Fl -rsh Ns = Ns Ar program
  98. Specify alternative communication program, defaults to
  99. .Xr ssh 1 .
  100. .It Fl -exclude Ar pattern
  101. Exclude files matching
  102. .Em pattern .
  103. .It Fl -exclude-from Ns = Ns Ar file
  104. Load
  105. .Em patterns
  106. and
  107. .Em rules
  108. from
  109. .Em file .
  110. .It Fl -devices
  111. Also transfer device files.
  112. .It Fl g , -group
  113. Set the group name to match the source.
  114. For example, group
  115. .Qq kristaps
  116. with ID 1000 on a remote server is matched to group
  117. .Qq kristaps
  118. on the local machine with ID 2000.
  119. If
  120. .Fl -numeric-ids
  121. is also given or if the remote group name is unknown on the local machine,
  122. set the numeric group ID to match the source instead.
  123. .It Fl I , -ignore-times
  124. Do not skip based on file size and modification time.
  125. .It Fl -include Ar pattern
  126. Include files matching
  127. .Em pattern .
  128. .It Fl -include-from Ns = Ns Ar file
  129. Load
  130. .Em patterns
  131. and
  132. .Em rules
  133. from
  134. .Em file .
  135. .It Fl J , -omit-link-times
  136. Don't set symlink modification times to match the source.
  137. .It Fl l , -links
  138. Also transfer symbolic links.
  139. The link is transferred as a standalone file: if the destination does
  140. not exist, it will be broken.
  141. .It Fl -max-size Ar size
  142. Don't transfer any file that is larger than
  143. .Ar size
  144. bytes.
  145. Alternatively
  146. .Ar size
  147. may instead use a multiplier, as documented in
  148. .Xr scan_scaled 3 ,
  149. to specify the size.
  150. .It Fl -min-size Ar size
  151. Don't transfer any file that is smaller than
  152. .Ar size
  153. bytes.
  154. See
  155. .Fl -max-size
  156. on the definition of size.
  157. .It Fl n , -dry-run
  158. Do not actually modify the destination.
  159. Mainly useful in combination with
  160. .Fl v .
  161. .It Fl -no-motd
  162. Do not display the Message of the Day.
  163. .It Fl -numeric-ids
  164. Ignore user and group names, use numeric user and group IDs only.
  165. Has no effect unless
  166. .Fl g
  167. or
  168. .Fl o
  169. is also given.
  170. .It Fl O , -omit-dir-times
  171. Don't set directory modification times to match the source.
  172. .It Fl o , -owner
  173. Set the user name to match the source, with similar matching logic as for
  174. .Fl g .
  175. If
  176. .Fl -numeric-ids
  177. is also given or if the remote user name is unknown on the local machine,
  178. set the numeric user ID to match the source instead.
  179. Only works if run as root.
  180. .It Fl p , -perms
  181. Set destination file or directory permissions to match the source when
  182. it is updated.
  183. .It Fl -port Ns = Ns Ar service
  184. Specify an alternative TCP port number.
  185. The
  186. .Ar service
  187. can be given as a decimal integer or as a name to be looked up in the
  188. .Xr services 5
  189. database.
  190. The default is
  191. .Dq rsync .
  192. .It Fl r , -recursive
  193. If
  194. .Ar source
  195. designates a directory, synchronise the directory and the entire subtree
  196. connected at that point.
  197. If
  198. .Ar source
  199. ends with a slash, only the subtree is synchronised, not the
  200. .Ar source
  201. directory itself.
  202. If
  203. .Ar source
  204. is a file, this has no effect.
  205. .It Fl -rsync-path Ns = Ns Ar program
  206. Run
  207. .Ar program
  208. on the remote host instead of the default
  209. .Pa rsync .
  210. .It Fl -size-only
  211. Skip files based only on size, don't check timestamp.
  212. .It Fl -specials
  213. Also transfer fifo and unix domain socket files.
  214. .It Fl -timeout Ns = Ns Ar seconds
  215. Set the I/O timeout in seconds.
  216. Exit if no data was transferred for the specified time.
  217. The default is 0, which means no timeout.
  218. .It Fl t , -times
  219. Set destination file and directory modification time to match the source
  220. when it is updated or created.
  221. .It Fl V , -version
  222. Print version and exit.
  223. .It Fl v , -verbose
  224. Increase verbosity.
  225. Specify once for files being transferred, twice for specific status,
  226. thrice for per-file transfer information, and four times for per-file
  227. breakdowns.
  228. .It Fl x
  229. Do not cross filesystem boundaries.
  230. If this option is repeated, all mount point directories from the copy are
  231. omitted.
  232. Otherwise, it includes an empty directory at each mount point it encounters.
  233. .El
  234. .Pp
  235. A remote
  236. .Ar source
  237. or
  238. .Ar directory
  239. has the syntax
  240. .Ar host : Ns Ar path
  241. for connecting via
  242. .Xr ssh 1 ,
  243. or
  244. .Cm rsync Ns :// Ns Ar host Ns / Ns Ar path
  245. or
  246. .Ar host Ns :: Ns Ar path
  247. for connecting to a remote daemon.
  248. Subsequent to the first remote
  249. .Ar source ,
  250. the host may be dropped to become just
  251. .Pf : Ar path
  252. or
  253. .Pf :: Ar path .
  254. .Pp
  255. For connecting to a remote daemon with
  256. .Cm rsync Ns :// Ns Ar host
  257. or
  258. .Ar host Ns :: Ns Ar path ,
  259. the first path component is interpreted as a
  260. .Qq module :
  261. .Ar host Ns :: Ns Ar module Ns / Ns Ar path .
  262. This only applies to the first
  263. .Ar source
  264. invocation; subsequent to that, the module should not be specified.
  265. .Pp
  266. By default, new destination files and directories are given the current
  267. time and the source file permissions.
  268. Updated files retain their existing permissions.
  269. It is an error if updated files have their file types change (e.g.,
  270. updating a directory with a file).
  271. .Pp
  272. At this time,
  273. .Ar source
  274. may only consist of regular files, directories
  275. .Pq only with Fl r ,
  276. or symbolic links
  277. .Pq only with Fl l .
  278. The destination
  279. .Ar directory
  280. must be a directory and is created if not found.
  281. .\" .Sh PATTERNS AND RULES
  282. .\" .Sh ENVIRONMENT
  283. .\" .Sh FILES
  284. .Sh EXIT STATUS
  285. The
  286. .Nm
  287. utility exits 0 on success, 1 if an error occurs, or 2 if the remote
  288. protocol version is older than the local protocol version.
  289. .Sh EXAMPLES
  290. All examples use
  291. .Fl t
  292. so that destination files inherit the source time.
  293. If not changed, subsequent invocations of
  294. .Nm
  295. will then consider the file up to date and not transfer block hashes.
  296. .Pp
  297. To update the out-of-date remote files
  298. .Pa host:dest/bar
  299. and
  300. .Pa host:dest/baz
  301. with the local
  302. .Pa ../src/bar
  303. and
  304. .Pa ../src/baz :
  305. .Pp
  306. .Dl % rsync -t ../src/bar ../src/baz host:dest
  307. .Pp
  308. To update the out-of-date local files
  309. .Pa bar
  310. and
  311. .Pa baz
  312. with the remote files
  313. .Pa host:src/bar
  314. and
  315. .Pa host:src/baz :
  316. .Pp
  317. .Dl % rsync -t host:src/bar :src/baz \&.
  318. .Pp
  319. To update the out-of-date local files
  320. .Pa ../dest/bar
  321. and
  322. .Pa ../dest/baz
  323. with
  324. .Pa bar
  325. and
  326. .Pa baz :
  327. .Pp
  328. .Dl % rsync -t bar baz ../dest
  329. .\" .Sh DIAGNOSTICS
  330. .Sh SEE ALSO
  331. .Xr ssh 1
  332. .Sh STANDARDS
  333. .Nm
  334. is compatible with rsync protocol version 27
  335. as supported by the samba.org implementation of rsync.
  336. .Sh HISTORY
  337. The
  338. .Nm
  339. utility has been available since
  340. .Ox 6.5 .
  341. .Sh AUTHORS
  342. The
  343. .Nm
  344. utility was written by
  345. .An Kristaps Dzonsons Aq Mt kristaps@bsd.lv .
  346. .\" .Sh CAVEATS
  347. .\" .Sh BUGS