git-annex/doc/special_remotes/rsync.mdwn
Joey Hess 43701759a3
disable shellescape for rsync 3.2.4
rsync 3.2.4 broke backwards-compatability by preventing exposing filenames
to the shell. Made the rsync and gcrypt special remotes detect this and
disable shellescape.

An alternative fix would have been to always set RSYNC_OLD_ARGS=1.
Which would avoid the overhead of probing rsync --help for each affected
remote. But that is really very fast to run, and it seemed better to switch
to the modern code path rather than keeping on using the bad old code path.

Sponsored-by: Tobias Ammann on Patreon
2022-05-03 12:12:41 -04:00

61 lines
2.5 KiB
Markdown

This special remote type rsyncs file contents to somewhere else.
Setup example:
# git annex initremote myrsync type=rsync rsyncurl=rsync://rsync.example.com/myrsync keyid=id@joeyh.name encryption=shared
# git annex describe myrsync "rsync server"
Or for using rsync over SSH
# git annex initremote myrsync type=rsync rsyncurl=ssh.example.com:/myrsync keyid=id@joeyh.name encryption=shared
# git annex describe myrsync "rsync server"
## configuration
These parameters can be passed to `git annex initremote` to configure rsync:
* `rsyncurl` - Required. This is the url or `hostname:/directory` to
pass to rsync to tell it where to store content.
* `encryption` - One of "none", "hybrid", "shared", or "pubkey".
See [[encryption]].
* `keyid` - Specifies the gpg key to use for [[encryption]].
* `exporttree` - Set to "yes" to make this special remote usable
by [[git-annex-export]]. It will not be usable as a general-purpose
special remote.
* `shellescape` - Optional. This has no effect when using rsync 3.2.4 or
newer. Set to "no" to avoid shell escaping
normally done when using older versions of rsync over ssh. That escaping
is needed with typical setups, but not with some hosting providers that do
not expose rsynced filenames to the shell. You'll know you need this
option if `git annex get` from the special remote fails with an error
message containing a single quote (`'`) character. If that happens, you
can run enableremote setting shellescape=no.
* `chunk` - Enables [[chunking]] when storing large files.
This is typically not a win for rsync, so no need to enable it.
But, it makes this interoperate with the [[directory]] special remote.
The `remote.name.annex-rsync-options` git configuration setting can be used
to pass parameters to rsync. To pass parameters to rsync only when it's
downloading and uploading, use `remote.name.annex-rsync-download-options`
and `remote.name.annex-rsync-upload-options`
## annex-rsync-transport
You can use the `remote.name.annex-rsync-transport` git configuration
setting to choose whether we run rsync over ssh or rsh. This setting
is also used to specify parameters that git annex will pass to ssh/rsh.
ssh is the default transport; if you'd like to run rsync over rsh:
git config remote.name.annex-rsync-transport rsh
To pass parameters to ssh/rsh, include the parameters after "rsh" or
"ssh". For example, to configure ssh to use the private key at
`/path/to/private/key`:
git config renote.name.annex-rsync-transport "ssh -i /path/to/private/key"