You can avoid the password prompt by setting the environment variable RSYNC_PASSWORD to the password you want to use or using the --password-file option. WARNING: On some systems environment variables are visible to all users.
On those systems using --password-file is recommended.
Any changes in the other preserved attributes (as requested by options) are made on the destination file directly when the quick check indicates that the file's data does not need to be updated.
For instance, all these work: This word-splitting still works (by default) in the latest rsync, but is not as easy to use as the first method.
If you need to transfer a filename that contains whitespace, you can either specify the --protect-args (-s) option, or you'll need to escape the whitespace in a way that the remote shell will understand.
[DEST] Access via remote shell: Pull: rsync [OPTION...] [[email protected]]HOST: SRC... [[email protected]]HOST: DEST Access via rsync daemon: Pull: rsync [OPTION...] [[email protected]]HOST:: SRC... It can copy locally, to/from another host over any remote shell, or to/from a remote rsync daemon.
[DEST] rsync [OPTION...] rsync://[[email protected]]HOST[: PORT]/SRC... It offers a large number of options that control every aspect of its behavior and permit very flexible specification of the set of files to be copied.
(This obviously requires the daemon to be running on the remote system, so refer to the STARTING AN RSYNC DAEMON TO ACCEPT CONNECTIONS section below for information on that.) Using rsync in this way is the same as using it with a remote shell except that: Some modules on the remote daemon may require authentication.
If so, you will receive a password prompt when you connect.
You can also specify any remote shell you like, either by using the -e command line option, or by setting the RSYNC_RSH environment variable.
Note that rsync must be installed on both the source and destination machines. You must specify a source and a destination, one of which may be remote.
You may also establish a daemon connection using a program as a proxy by setting the environment variable RSYNC_CONNECT_PROG to the commands you wish to run in place of making a direct socket connection.