OPENRSYNC(1)
π OPENRSYNC(1) π
okay so this is openrsync, from the General Commands Manual bestie, and we're about to synchronise local and remote files like it's nothing β¨
πΈ NAME πΈ
openrsync β synchronise local and remote files π¦
π SYNOPSIS π
openrsync [-aDgIJlnOoprtVvx] [-e program] [--address=sourceaddr]
[--compare-dest=directory] [--contimeout=seconds] [--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] [--size-only] [--timeout=seconds]
source ... directory
β¨ DESCRIPTION β¨
so the way this works π
β openrsync makes the files in the destination directory match up with one or more source files. The glow-up, basically.
Either the source or the destination directory may be remote, but not both. That's the rule, no cap π
The arguments are as follows:
π OPTIONS π
-a,--archiveβ the iconic shorthand, literally just-Dgloprtbundled up π--address=sourceaddrβ when you're connecting to an rsync daemon, usesourceaddras the source address for the connections. Super handy on machines with multiple interfaces, iykyk π¦--compare-dest=directoryβ usedirectoryas an alternate base directory to compare files against, on the destination machine. If a file indirectoryis found and it's identical to the sender's file, the file just won't be transferred β saving you that bandwidth, periodt. Multiple--compare-destdirectories may be provided. Ifdirectoryis a relative path, it's relative to the destination directory. π«Ά--contimeout=secondsβ set the connection timeout, in seconds. Exit if no connection gets established within the specified time. The default is0, which means no timeout at all β³-Dβ also transfer device and special files. Shorthand for--devices --specialsπ--del,--deleteβ delete files indirectorythat aren't found in the source directories. Only applicable with-rβ οΈ (yes, it deletes. be so for real before you run it π)-e program,--rsh=programβ specify an alternative communication program. Defaults tossh(1)π--exclude patternβ exclude files matchingpatternπ--exclude-from=fileβ load patterns and rules fromfileπ--devicesβ also transfer device files π§-g,--groupβ set the group name to match the source. Example time bestie: group"kristaps"with ID1000on a remote server gets matched to group"kristaps"on the local machine with ID2000. But if--numeric-idsis also given, or if the remote group name is unknown on the local machine, set the numeric group ID to match the source instead π-I,--ignore-timesβ do not skip based on file size and modification time π--include patternβ include files matchingpatternβ--include-from=fileβ load patterns and rules fromfileπΈ-J,--omit-link-timesβ don't set symlink modification times to match the source π¦-l,--linksβ also transfer symbolic links. The link is transferred as a standalone file: if the destination doesn't exist, it will be broken π (we love a standalone queen but she's fragile)--max-size sizeβ don't transfer any file larger thansizebytes. Alternatively,sizemay instead use a multiplier, as documented inscan_scaled(3), to specify the size π--min-size sizeβ don't transfer any file smaller thansizebytes. See--max-sizefor the definition ofsizeπ-n,--dry-runβ do not actually modify the destination. Mainly useful in combination with-vπ (vibe check first, always)--no-motdβ do not display the Message of the Day π ββοΈ--numeric-idsβ ignore user and group names, use numeric user and group IDs only. Has no effect unless-gor-ois also given. β οΈ-O,--omit-dir-timesβ don't set directory modification times to match the source π-o,--ownerβ set the user name to match the source, with similar matching logic as for-g. If--numeric-idsis 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β set destination file or directory permissions to match the source when it's updated π‘οΈ--port=serviceβ specify an alternative TCP port number. Theservicecan be given as a decimal integer or as a name to be looked up in theservices(5)database. The default is"rsync"π-r,--recursiveβ ifsourcedesignates a directory, synchronise the directory and the entire subtree connected at that point. Ifsourceends with a slash, only the subtree is synchronised, not thesourcedirectory itself. Ifsourceis a file, this has no effect π³ (the slash matters, bestie, don't play with it)--rsync-path=programβ runprogramon the remote host instead of the defaultrsyncπ--size-onlyβ skip files based only on size, don't check timestamp β±οΈ--specialsβ also transfer fifo and unix domain socket files π§ββοΈ--timeout=secondsβ set the I/O timeout in seconds. Exit if no data was transferred for the specified time. The default is0, which means no timeout π€-t,--timesβ set destination file and directory modification time to match the source when it's updated or created π°οΈ-V,--versionβ print version and exit π-v,--verboseβ 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 π£οΈπ£οΈπ£οΈπ£οΈ-xβ do not cross filesystem boundaries. If this option is repeated, all mount point directories from the copy are omitted. Otherwise, it includes an empty directory at each mount point it encounters π§
okay now the β¨loreβ¨ about remote paths, because this is where people get confused:
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 π«Ά
π₯ EXIT STATUS π₯
0β success, slay π1β an error occurred π2β the remote protocol version is older than the local protocol version π
π 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 will update the remote contents instead:
% openrsync -av --delete /local/path remote:rpath
ngl all examples use-tso that destination files inherit the source time. If not changed, subsequent invocations ofopenrsyncwill 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 π
π STANDARDS π
openrsync is compatible with rsync protocol version 27 as supported by the samba.org implementation of rsync π€
π¦ HISTORY π¦
The openrsync utility has been available since OpenBSD 6.5 π
π AUTHORS π
The openrsync utility was written by Kristaps Dzonsons <kristaps@bsd.lv> π
and that's the whole page bestie!! this one came from Debian, dated $Mdocdate$, and it's OPENRSYNC(1) all the way down π«Άβ¨ go forth and synchronise responsibly, mwah π
π¦ where this page comes from
- nixos 26.05: openrsync-unstable 2025-01-27
- Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms