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 does not 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 the following table.

Source

Destination

Description

srcpath [...]

[user@]host:destpath

Transfer local directory srcpath to remote directory destpath.[a]

[user@]host: srcpath

destpath

Transfer remote directory srcpath to local directory destpath.[a]

[user@]host:srcpath

List contents of srcpath without transfering anything.[a]

srcpath [...]

[user@]host::destpath

Transfer local directory srcpath to remote directory destpath. [b]

[user@]host::srcpath

Get Mac OS X in a Nutshell now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.