Name

rsync

Synopsis

rsync [options] sources dest

Transfer files; used frequently for updating files across a network. File transfer with rsync is fast and efficient because it checks local files against remote files in small chunks, or blocks, and transfers only the blocks that differ between the files.

sources and the final dest are in the form of:

user@host:port/filename

If the file is on the local host, a plain filename can be specified. If the file is on a remote host, the host must also be specified. user can optionally be specified to log in as a different user on the remote site (in which case a password prompt might appear) and port can optionally be specified with a remote host to make rsync use a TCP port other than its default, 873.

Relative filenames (names without initial slashes) are handled relative to the user’s home directory. If a source directory is listed with a trailing slash, the whole directory is transferred and will appear under the destination directory; if the directory is listed without the slash, its files and subdirectories will appear directly under the destination directory. Normally, regular directories and files are transferred, but not symbolic links or other special files such as sockets and FIFOs.

Two other formats for sources and dest, which refer to files on an rsync server (rsyncd), are:

user@host::filename
rsync://user@host:port/filename

rsync servers are beyond the scope of this book.

Options

−0, --from0

Specify that the file specified in options such ...

Get Linux in a Nutshell, 6th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.