rsync
rsync (samba.org manual page) is a data transfer utility that is capable of syncing data sets between two computers. It can synchronize the contents of a file or folder between the local computer and a destination computer, either to ensure that all of the latest source data exists on the destination or to make the contents of the destination absolutely identical to the source. It does this by first assessing the differences between the two copies of the data, then transferring only that data which is missing or older on the destination. By only doing the work that is needed, rsync can be more efficient than FTP, SCP or SFTP.
An example of the basic rsync syntax is very similar to that for SCP:
rsync
provides quite a few options, with some of the most useful being:
- -v
- reports a "verbose" amount of information during the transfer.
- -r
- recursively transfers a whole directory.
- -a
- puts the transfer into archive mode, so that symbolic links, devices, attributes, permissions and ownership are preserved.
- -t
- preserves modification times of the data rather than using the transfer time.
- --delete
- removes files from the destination that are not present in the source.
- -z
- compresses data during the transfer.
- -n
- performs a "dry run", merely printing the changes that would be made during an actual copy.
- -P
- keeps partially transferred files. During the next similar command, rsync can successfully transmit only the remainder of the partial files. If a file changes before its remainder is transmitted, the result is likely to be corrupted.
By default, rsync uses SSH to securely establish a connection to the remote system.
It can also be configured to use other shells or to contact an rsync daemon that is running on the remote server.
For more information on these and other options in your particular version of rsync,
issue the command man rsync
on your system.
If the rsync tool is not already installed on your system, you can install it yourself. There is also a GUI clients that makes it even easier to use rsync.