Running rsync as a daemon - backup

I am running OpenHABian 3.3 on a RPi 4 and would like to run rsync as a daemon (rsyncd) as part of my backup regime. I run a backup server (using backuppc/Ubuntu) which backs up all the computers in the house, including other RPis running Raspbian. On a stock Raspbian or Ubuntu set up I would

  • install rsync
  • run it as as a daemon (sudo rsync --daemon --no-detach)
  • set up a config and password file at /etc/rsyncd.config and /etc/rsyncd.secrets
  • and checking it is running ok (sudo service rsync status/start/restart)
  • initiate the backup from the backup server and ‘presto’

However on OpenHABian the service fails.

‘sudo service rsync status’ results in
Process: 25351 ExecStart=/usr/bin/rsync --daemon --no-detach (code=exited, status=10)
Main PID: 25351 (code=exited, status=10)

‘systemctl list-unit-files |grep rsync’ results in
rsync.service enabled

Grateful for any help. I don’t really want to have a separate backup approach for OH3.

You should because there is no good one-size-fits all backup strategy.
openHABian has all the backup tools it takes and they’re optimized to minimize MTTR if in need. You can have mirrored boot SDs and keep multiple generations of your files in backup.
That’s superior to and is not available on any simple rsync approach.
Check out the backup video series on openHAB 3 Backup Series Part 1 | Manually Backup Your OH3 Configuration | openhabian Tool - YouTube

(FWIW you could also use Amanda on either your Raspi or your backuppc to backup your other systems.)

Ok great. Yes I can mirror SD cards and have done before. It is not something that i plan, or would expect anyone else, to do weekly or even monthly, wheras an rsync update can do daily sheduled updates. (My habit for my non-RPi servers is always to have RAID1 system disks so i get the point about MTTR).

And, yes, a layered backup solution is good practice. However, layering does not mean it is sensible to layer an Amanda backup solution on top of an existing BackupPC solution. Both should be valid alternatives.

I am not sure if you are asserting that the OH3 backup file is comprehensive? I belive it is just a config backup. So as a minimum the rsync backup should be able to do the same and backup the config files but with the advantage of doing it on the fly daily, allowing a new OS install to be reconfigured if need be.

So, would it be possible to address the original question which is - how do i get the rsync daemon to run on Openhabian OS?

It’s as cheap as another SD card with an USB reader so why not ?
Actually it is a combination of full mirroring every some months and daily rsync of the diffs (no it does not use any demon for that).

Isn’t it the other way round ? Your solution doesn’t work (yet) while Amanda is proven to work in many openHABian installations so why replace or layer your stuff on top of it ?

Yes and no. It’s a OH config backup only, right. But you can reinstall openHABian from scratch and even fully automated import the backup file during the installation so if openHAB itself is all you use of openHABian then yes, that IS comprehensive.
Else (if you also use any of the other tools such as Mosquitto and want to backup those, too) then you would want to use Amanda.

Bottom line is, openHABian is an appliance, not an OS, and has its own concepts for backup.
Any sort of individualization of the system might harm stability and will ultimately increase your MTTR. So better use what it provides, it’s optimized and proven to work for many others.

I didn’t start the thread to debate the merits of backup approaches but just to ask how to get the rsync service to start… If anyone to help me with that it would be great, or equally to say that it will never work with OpenHABian because of x, y & z, that would be OK.

As you want to benefit from the work we have put into openHABian for you and everybody, may I kindly ask you to respect this (to the end of the paragraph). Thank you.

I find this rather strange and surprising. I haven’t encountered this type of response in other open-source communities. I agree with many of the points in the text at the link including “Your setup is untested, and no-one but you knows about your changes”, and “when you deliberately decide to make manual changes to the OS software packages and configuration (i.e. outside of openhabian-config), you will be on your own” - that sort of goes with the territory for open source products. Also, I fully understand that the maintainers will be focussed on maintaining a robust product under tight configuration control with understood dependencies etc. The work that the maintainers and the development community put into the software is greatly appreciated and I wouldn’t want to distract or detract from that.

However, what surprises me is that it goes on to say “if you choose to deviate from the standard openHABian installation … don’t waste maintainer’s or anyone’s time by asking for help or information on your issues on the forum”. This doesn’t come across as very inclusive or community-spirited, whereas other communities adopt the principle of ‘there is no such thing as a stupid question’ - which to me seems appropriate for software with a wide rage of users with a variety of skills and experience and a variety of home automation use-cases to support. After all, it is within the control of the reader to decide whether to engage and reply or not.

In this instance, I asked what I thought was a benign question about running a pretty standard linux service and got involved in a debate about how doing so could, for non-specific reasons, break my system and why I should use other backup approaches. I’m sorry that I did ask the question but in case it helps anyone, after an update and a couple of reboots the rsync daemon service started and it hasn’t broken my system, it carries on working perfectly. I hope that helps in some small way to the development of OH3.