Clarification on openhab-cli backup command and its handling of data persistence during power loss

Hello, I would like some clarification regarding the /openhab-cli backup --full command in OpenHAB.

Specifically, I am wondering if the command performs a backup of data physically written to the eMMC or if it also includes the ZRAM data before proceeding with the backup.

In case of an unexpected power loss or SSD failure, would the persistence data be lost, or is it protected in these backups?

For example, let’s say I don’t reboot the system for 10 days and perform daily backups. In case of a power loss, would the persistence data be updated daily in the backups, or would it remain as of the last reboot?

Any insights would be greatly appreciated! Thank you in advance.

The backup command creates a zip file which contains all configuration (i.e. $OPENHAB_CONF and some parts of $OPENHAB_USERDATA, afaik ./config, ./etc/ and ./jsondb/).
If adding --full, it will also contain the subdirectories ./persistence/ and ./cache/.

The backup is stored in $OPENHAB_USERDATA/backups if no path is given through the backup command.

Please be aware that the backup command will create new files but not delete old ones, so best practice may be to move the zip file to an external drive (maybe a NAS?) and delete the file afterwards.

Hi, thanks for your response!

Actually, I have been using the openhab-cli backup --full command for some time and I am already aware of what is included in the backup, such as configurations and data from the ./config, ./etc, ./jsondb, ./persistence, and ./cache directories.

My specific concern is regarding persistence data that is in Z-RAM. When this data has not yet been written to the SD card due to a reboot of OpenHAB, is it included in the daily backup? Or, in case of power loss before a reboot, could the persistence data that hasn’t been written to the SD be lost?

I hope this clarifies my question. Thanks in advance for any further details!

ZRAM is overlay, so yes, it should be included in the backup.