I came across something I did not know and temporarily messed things up. I have an openhabian RPI3 with Zram installed. Bottom line is that these two folders that are normally the same can be different. Since there files are both using Zram, I suspect a connection. I’m not sure how they are supposed to sync, but two stories of my adventures below.
/srv/openhab2-log
/var/log/openhab2
/srv/openhab2-userdata/persistence/mapdb
/var/lib/openhab2/persistence/mapdb
First I like a minimal log file, so I have periodically stopped OH, deleted all the entries and then restarted. I came across a post that suggested I could delete the log file while OH is running and it would just create a new one. I deleted the file in /srv/openhab2-log
, but nothing ever came back. However, the file was still in /var/log/openhab2
. It took a restart to get the files in sync.
Second when upgrading my other Rpi4 to OH3, I needed to delete the mapdb files to clear an error. Once I found the files were in two places, I went back to my Rpi3 and noticed that the files in the /srv
location were dated back in October. We had long power outage back then and I was not around to properly shutdown until my UPS was drained. Unfortunately I did not check /var
location at that time. Simply uninstall/install mapdb did not work. Today I uninstalled Mapdb, deleted the mapdb files in both locations, uninstalled Zram, reinstalled Zram, reinstalled MapDB and both locations are synced again.
I also now have a faster method to get the Rpi3 shutdown in the event of a power outage.
Bob