ESPHome-Backup of configuration files & exclude all non *.yaml files/directories
DutchmanNL opened this issue · comments
ESPHome adapter requires an directory to store configuration of devices, these are yaml files which I store in
/opt/iobroker/iobroker-data/$instanceName
https://github.com/DrozmotiX/ioBroker.esphome/blob/main/io-package.json#L230
Issue:
ESPHome dasboard uses this directory to store its configuration files, but also downloaded library's required to build ESP devices.
As a consequence of that, ioBroker backups get a huge size as all compiled libraries are included
FeatureRequest:
Special treatment for ESPHome adapter to:
- Allow backing up the directory "esphome.%INSTANCE%",
- Only backup files with file extension *.yaml
- ignore all other files and folders in that directory
Related to : DrozmotiX/ioBroker.esphome#129
This is a topic for the js controller. Backitup backs up using the js-controller method.
But I remember that a different directory would make sense for the ESP Home Adapter. @Apollon77 can certainly say something about that.
There are directories that are not backed up by the iobroker backup.
This is a topic for the js controller. Backitup backs up using the js-controller method. But I remember that a different directory would make sense for the ESP Home Adapter. @Apollon77 can certainly say something about that.
There are directories that are not backed up by the iobroker backup.
that's the problem :)
I can use the JS-controller backup by adding the directory (which I currently did) but looking for a solution to backup that directory but only the yaml files. @Apollon77 pointed me to discuss in Backit-up
Well the backup strategy comes from the js controller.
Backitup only uses this. In the end, Backitup doesn't do anything other than run the “iob backup” command in the standard backup.
Don't think I can do anything about it in Backitup.
I already mentioned this in an issue with you. Wouldn't it make sense to just temporarily store the files for compiling?
Some people have already filled their memory with it.
I already mentioned this in an issue with you. Wouldn't it make sense to just temporarily store the files for compiling?
Some people have already filled their memory with it.
problem is that this is totally out of control from the adapter and managed in ESPHome dashboard.
people can cleanup their build files which would avoid this issue in the backup and still is an manual task.
Only reason default backup is taking this directory into consideration is that I added it as data folder.
So if I remove it out there, we have no backup at all anymore for ESPHome
What would be a suitable solution to continue ? I cannot enforce cleanup of the build files, so looking for a solution that only *.yaml files of the esphome instance specific folder will be included in an backup and all others skipped
@simatec and haveing an "adapter specific backup method"? So like for zigbee or such?
@DutchmanNL @Apollon77 I can very happily add a backup for the yaml of the ESP home.
However, the ESP-Home adapter would have to be adapted independently.
Currently, the complete directory including compilation data is packed into the iobroker backup.
My suggestion... ESP-Home will be adapted and the data folder with all yaml files will no longer go into the iobroker backup and I will add an option for the additional backup of the yaml.
My suggestion... ESP-Home will be adapted and the data folder with all yaml files will no longer go into the iobroker backup and I will add an option for the additional backup of the yaml.
I like that approach ! As soon we have it in backup I can removed the data-folder entry in my io-package json and by that normal backup wil not touch it anymore
Can you please give me the exact path and file extension of the files to be backed up?
Can you please give me the exact path and file extension of the files to be backed up?
sure
Path: always /opt/iobroker/iobroker-data/esphome.0 (were 0 = instance name, so if you have multiple instance that changes should be a wildcard
content of the directory looks like:
root@ioBroker:/opt/iobroker/iobroker-data/esphome.0$ ls -l
.esphome
.gitignore
cameratest01.yaml
cameratest02.yaml
display.yaml
esphome-web-d739ec.yaml
fonts
kelder.yaml
ketel-ruimte.yaml
keuken.yaml
secrets.yaml
test-light.yaml
testnodemcu.yaml
woonkamer-vensterbank.yaml
woonkamer_houtcvkachel.yaml
Basically all in this directory should be part of the backup except build files which are stored in the hidden folder .esphome
So instead of only backing up yaml files, as some people also add custom fonts and components, we should exclude all directories which are hidden:
.esphome
.gitignore
That would ensure that the big libraries (build files) are excluded from backups, build files are stored in
/opt/iobroker/iobroker-data/esphome.0/.esphome/build/
is fonts a directory?
is fonts a directory?
yes, fonts is an directory and there can be more directory's if people add custom plugins, therefore we should only exclude the 2 mentioned directories
added in v2.9.1