Name

rsync

Synopsis

rsync [options] source destination

Transfers files from source to destination. rsync is a synchronization system that uses checksums to determine differences (instead of relying on modification dates) and does partial file transfers (transferring only the differences instead of the entire files).

rsync can use a remote shell (rsh by default) as a transport, in which case the remote host must have rsync installed as well. You can use a remote shell like ssh instead of the default by specifying that in options.

You can also use rsync without a remote shell, in which case rsync requires that the remote host run an rsync server daemon. For details on the advanced features of rsync, including running an rsync server, refer to rsync’s manpage. The following descriptions and examples cover rsync’s basic operation.

rsync doesn’t preserve resource forks or HFS metadata when copying files that contain them.

The rsync source and destination arguments can be specified in several ways, as shown in Table 2-7.

Table 2-7. rsync source and destination arguments

Source

Destination

Description

a Uses a remote shell as the transport and requires rsync on the remote host.

b Doesn’t use a remote shell but requires an rsync server running on the remote host. Note the double colons (::), except for the URL format.

srcpath [...]

[user@]host:destpath

Transfer local directory srcpath to remote directory destpath. a

[user@]host: srcpath

destpath

Transfer remote directory srcpath ...

Get Mac OS X Tiger in a Nutshell 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.