summaryrefslogtreecommitdiff
path: root/doc/special_remotes/rsync.mdwn
blob: 628d2e8cbf424bc16e88d3228a5742ac1ca4816d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
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=joey@kitenet.net 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=joey@kitenet.net 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]].

* `shellescape` - Optional. Set to "no" to avoid shell escaping normally
  done when using 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 `annex-rsync-options` git configuration setting can be used to pass
parameters to rsync.

## annex-rsync-transport

You can use the `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, modify your
.git/config to include

        annex-rsync-transport = rsh

under the appropriate remote.

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`, specify

         annex-rsync-transport = ssh -i /path/to/private/key

Note that environment variables aren't expanded here, so for example, you
cannot specify `-i $HOME/.ssh/private_key`.