# Rsync error



## balanga (Jun 9, 2016)

I'm trying to get net/rsync setup between two FreeBSD hosts one on the Internet and the other on a local network. net/rsync has just been installed on both systems using `pkg install rsync`.

Pulling from the remote host using 

`rsync -av 111.111.111.111::test /tmp`

works fine, but pushing fails with this error:


```
sending incremental file list
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(226) [sender=3.1.2]
```

Does anyone know what this means? I don't currently have any security in place, as far as I aware. Or have I simply got the syntax wrong? 

`rsync -av /tmp 111.111.111.111::test`

rsyncd is running on the remote host.


----------



## SirDice (Jun 9, 2016)

There are two colons when there's supposed to be only one. The double colon variant requires the rsync(8) daemon running on the receiving end.


----------



## kpa (Jun 9, 2016)

Using SSH as transport for net/rsync is preferred unless you're setting a public rsync repository, even then setting up anonymous read-only SSH access might be a better idea than using the rsync daemon.


----------



## balanga (Jun 9, 2016)

SirDice said:


> There are two colons when there's supposed to be only one. The double colon variant requires the rsync(8) daemon running on the receiving end.



I'm not sure that what you say agrees with the man page

rsync(1)

```
SYNOPSIS
       Local:  rsync [OPTION...] SRC...    [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
```
The rsync daemon is running on the remote (receiving) end.

I thought I'd try the second variant but can't stumble across the correct syntax.

Apologies for those funny faces, I have no idea what caused that.


----------



## SirDice (Jun 9, 2016)

balanga said:


> Apologies for those funny faces, I have no idea what caused that.


Not using the correct tags tends to do that.

Thread 45189

The form: `rsync /local server:/remote` uses ssh(1) and doesn't require the rsync(8) daemon on the receiving end. It does require the net/rsync package to be installed. 

The form: `rsync /local server::remote` requires the rsync(8) daemon to run on the receiving end. It would also need to be configured so it knows what the remote module is. 

Most people (myself included) usually only use the first form.


----------



## balanga (Jun 10, 2016)

SirDice said:


> Not using the correct tags tends to do that.
> 
> Thread 45189
> 
> ...



I'd prefer to use the second form as it gives me more control at the receiving end via rsyncd.conf.

Unfortunately I can't get the syntax right....


----------



## fullauto2012 (Jun 22, 2016)

Can you run the net/rsync syntax you use with the -v (verbose) option and post the results?
I just tackled net/rsync for the first time recently and I was trouble shooting the exact thing you were trying to do and think I could help.


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

so on the machine you are trying to push from:
`rsync -v /usr/home/YourUserDir/FileToXfer rsync://YourRsyncSecret@HostNameOrIP:3551/ModuleName`


----------

