Utilities
1.1 seq
1.2 tmux
1.3 tree
1.4 rsync
1.5 SFTP
On this page:
1.4.1 Synopsis
1.4.2 Advanced usage
1.4.3 Connecting to an rsync daemon
1.4.4 Options
1.4.5 Examples
1.4.6 Version
1.4.7 Author
8.1

1.4 rsync

rsync – a fast, versatile, remote (and local) file-copying tool

1.4.1 Synopsis

Local:

        rsync [OPTION...] SRC... [DEST]

Access via remote shell:

        Pull:

                rsync [OPTION...] [USER@]HOST:SRC... [DEST]

        Push:

                rsync [OPTION...] SRC... [USER@]HOST:DEST

Access via rsync daemon:

        Pull:

                rsync [OPTION...] [USER@]HOST::SRC... [DEST]

                rsync [OPTION...] rsync://[USER@]HOST[:PORT]/SRC... [DEST]

        Push:

                rsync [OPTION...] SRC... [USER@]HOST::DEST

                rsync [OPTION...] SRC... rsync://[USER@]HOST[:PORT]/DEST)

Usages with just one SRC arg and no DEST arg will list the source files instead of copying.

1.4.2 Advanced usage

The syntax for requesting multiple files from a remote host is done by specifying additional remote-host args in the same style as the first, or with the hostname omitted. For instance:

rsync -av host:file1 :file2 host:file{3,4} /dest/

1.4.3 Connecting to an rsync daemon

It is also possible to use rsync without a remote shell as the transport. In this case you will directly connect to a remote rsync daemon, typically using TCP port 873.

Some modules on the remote daemon may require authentication. If so, you will receive a password prompt when you connect. You can avoid the password prompt by setting the environment variable RSYNC_PASSWORD to the password you want to use or using the option:

--password-file=FILE

The file should contain just the password on the first line (all other lines are ignored). Rsync will exit with an error if FILE is world readable or if a root-run rsync command finds a non-root-owned file. This option does not supply a password to a remote shell transport such as ssh.

This may be useful when scripting rsync.

1.4.4 Options

Rsync accepts both long (double-dash + word) and short (single-dash + letter) options. When specifying a parameter, you can either use the form --option=param or replace the = with whitespace.

1.4.5 Examples

rsync -htvi --dry-run *.html institute:~/public_html/manual/

rsync -ht --stats *.html institute:~/public_html/manual/

For an heavy compressed file with spaces in its path and resuming after an interruption:

rsync -htsP institute:"/o w o/file name.mkv" .

rsync -htsP --append-verify institute:"/o w o/file name.mkv" .

1.4.6 Version

This man page is current for version 3.2.3 of rsync.

1.4.7 Author

rsync was originally written by Andrew Tridgell and Paul Mackerras. It is currently maintained by Wayne Davison.