I upgraded to Ubuntu 15.04 this weekend. Now, rsync won't play nice anymore:

When I try to run this:

beheer@boson:~ $ rsync -Wvvqaz --log-file=rs.txt --delete-excluded --delete --no-g --password-file=/home/beheer/rsync.local.pwd --exclude=lost+found /home  rsync://boson.local/boson-backup/boson/

I get:

rsync: failed to connect to boson.local ( Connection refused (111)
rsync error: error in socket IO (code 10) at clientserver.c(128) [sender=3.1.1]

the log-file contains:

2015/05/25 19:00:54 [15163] opening tcp connection to boson.local port 873
2015/05/25 19:00:54 [15163] rsync: failed to connect to boson.local ( Connection refused (111)
2015/05/25 19:00:54 [15163] rsync error: error in socket IO (code 10) at clientserver.c(128) [sender=3.1.1]

This is an attempt at a local backup. But, trying to do something similar from an external (Debian) server returns the exact same error.

$ systemctl |grep ufw
  ufw.service                 loaded active exited    Uncomplicated firewall

$ sudo ufw status
Status: inactive

$ sudo iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

Any suggestions what else I could check or what could be wrong?

EDIT: Using rsync via ssh as suggested in the comments below gives the same error.

EDIT2: updated firewall (ufw) status and added iptables state.

EDIT3: Shouldn't there be an rsyncd daemon running?

$ ps aux |grep rsync
beheer    8559  0.0  0.0   9492  2176 pts/0    S+   10:23   0:00 grep --color=auto rsync

systemctl also doesn't show any rsync service. No mention on Google that this is needed or how to create it.

  • I've never used rsync with an actual rsync server. Any reason you're not tunneling over ssh? (I suppose rsync would be faster since it skips the encryption, but just curious) – csgeek May 25 '15 at 18:49
  • This is all local traffic. Would, using ssh, help solve my problem or just add an extra layer of complexity? – Mausy5043 May 26 '15 at 8:23
  • well, assuming you have ssh working and setup. Try something along these lines: rsync -avP --log-file=rs.txt --delete-excluded --delete --no-g --exclude=lost+found /home user@boson.local:/boson-backup/boson/ that should be equivalent. You can also play around with -z (compression) and --compress-level=NUM (ie. balance between CPU usage and badwidth). I'm not sure if this would be a solution.. but like I said.. I've never had the need to setup an rsync server since ssh is just always available in all my env. Worth giving it a go and see if it works. (assuming ssh is open) – csgeek May 26 '15 at 17:39
  • @csgeek : This has the added problem that I need to enter a password, so I can't run this from a script. It then complains that it can't mkdir /boson-backup/boson. But boson-backup` is a module, it shouldn't be created. :-\ – Mausy5043 May 27 '15 at 19:41
  • ssh-keygen (generate a password less key). ssh-copy-id -i ~/.ssh/id_rsa.pub user@host, then it should work w/o a password and be just as secure. If you really want to give your crypto key a pass phrase you can play around with ssh-agent and such and still have your script work. – csgeek May 28 '15 at 0:55

The rsync.service IS installed. You just need to look very hard. ;-)

$ systemctl list-unit-files |grep rsync
rsync.service                          disabled

Since the service is disabled by default (...) you need to enable it and then start it.

$ sudo systemctl enable rsync.service
Synchronizing state for rsync.service with sysvinit using update-rc.d...
Executing /usr/sbin/update-rc.d rsync defaults
Executing /usr/sbin/update-rc.d rsync enable

$ sudo systemctl start rsync.service

And there you go:

$ systemctl |grep rsync
rsync.service                 loaded active running   fast remote file copy program daemon

This survives reboots. So no need to manually start the service after each boot.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.