Hi,
I can’t for the life of me work out how to install rsync on Hass.io.
Any ideas, I’m stumped & slightly embarresed.
Pretty sure you can’t do that… What are you wanting to backup? Have you looked at using snapshots? Anything you want to install in Hass.io requires an addon.
Yes, I want to automate backup by simply pushing the /backup folder onto my NAS.
Yeah… Best option is snapshots and then use Daniel Welsh’s Dropbox addon to backup to dropbox (and it will keep as many as you specify). Then on a computer that syncs with dropbox you can run a script/create a schedule to delete or move or whatever you want to do. That’s what I do.
Of course you don’t have to use dropbox if you have the SMB addon you can just copy but I like off-site as well with dropbox.
Thanks, Dropbox plugin worked great. Wish I had asked a few hours ago rather than wrestling with rsync install.
Yeah… It’s the disadvantage of Hass.io compared to hassbian or installing in a virtual environment. It’s a pretty locked down system as opposed to something you can tinker with significantly.
The benefit of Hass.io is the addons though.
A big advantage of rsync is that it works with both push and pull file transfers, ie you could install it on any server and have that server fetch files (pull) rather than having to install rsync on the computer to be backed up (push).
Combine this with the Hassio ssh addon and I assume you’ll be good to go. I haven’t tried myself as I don’t run hassio, just like @DavidFW1960 I find it way too limited.
You won’t get it to work in the ssh addon either. The addons work in different containers and don’t have access. There’s actually multiple threads about this from a week or so ago. A command_line sensor or script etc will access a different container to what the ssh addon does.
Jeez, really? I knew that hassio was limited but that bad?
You’re saying one can’t even use ssh to edit files? If not, what’s the point of the addon?
Controlling your device if the GUI doesn’t work, detail here.
EDIT: Addons may have acces to config, ssl, addons, backup, share
directories if those are mapped to the docker container.
I said no such thing
You can use SSH, and the community SSH add-on includes rsync. However, that’s a different container from Home Assistant so you can’t use that rsync in any automation.
Note: with current versions of Hassio and AddOns, I found that only the “SSH & Web Terminal” AddOn ships with rsync, but not the “SSH Server” AddOn.
I just found this thread since I was creating a Home Assistant addon for exactly this purpose. When it starts it syncs the specified folders and shuts itself down afterwards. If interested take a look here.
I use it to transfer the auto-generated snapshots to a second machine every night.
I arrived at this thread due to the roadblock of trying to figure out why I couldn’t install rsync after trying to process how a Linux system can even exist without it, lol. Fantastic add-on. Thank you for making this available. The only comment I would make is that it took me a while to figure out the trailing slash behavior as it’s exactly opposite of what I expect. The shell code looks correct and it must be due to the way the directories are presented in the container.
This behaves exactly like no trailing slashes (dumps the contents directly into the target directory):
folders:
- /config/
- /backup/
options: '-avhr'
This behaves as if I had included trailing slashes:
folders:
- config
- backup
options: '-avhr'
Since I’m currently not using this addon and the function wasn’t modified the last months I might rely on the documentation.
Is it correctly described there?
And always use the prefix-/ since the folder list is directly representing the file system.
Hello, for people with custom needs, I find a workaround: My solution to rsync to a lucks encrypted drive in Hass OS
But it is way more complicated than an AddOn.
I also had the need to “rsync” from within the hass container and found this thread. My approach:
As “ssh” is available in hass: Via ssh shell_command I ssh from within the container to the host, running a shell-script with the rsync command.
this quick and dirty solution works quite well and is usable e.g. within an automation etc.