Hello,
I’m running Openhab 3.3.0 on Openhabian and a Rasspberry Pi4 on SD-Card with activated ZRAM, rrjd as persistence service. Also I would like to use Amanda as well.
After the last blackout, I learned the hard way, that my setup is not resilient to it, loosing the persisted data since the last power-up (over 1 month in this case). This is the expected result as I figured out now.
So now I’m adding a UPS to the system to shutdown everything correctly.
But now I’m kind of lost. How to turn it off correctly?
I tried using sudo service openhab stop
but it seems that this does not secure that all data is correctly saved.
Here: ZRAM status it is said under “donts”, ZRAM needs to be shutdown properly, but not how to do so. They say to use Amanda to secure against blackouts.
I couldn’t find a “best practice” solution that was understandable for me.
How to shutdown the system correctly, saving all data and actually writing it to the filesystem?
I think Amanda then is “only” a way of a general backup strategy.
There’s no difference, as they both call the shutdown command.
sudo reboot = sudo shutdown -r
You would only lose data if power was lost before data was written from ZRAM (as happened with the power outage), which should not happen if you run shutdown or reboot.
Are you using Network UPS Tools? If so, the NUT monitoring client will shut down your RPi and there’s no need to run commands from openHAB.